MCPcopy Create free account
hub / github.com/TileDB-Inc/TileDB / check_update_conditions

Method check_update_conditions

test/src/unit-cppapi-update-queries.cc:186–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186void UpdatesFx::check_update_conditions(
187 std::vector<QueryCondition> qcs,
188 std::vector<std::vector<sm::UpdateValue>> uvs,
189 uint64_t timestamp,
190 bool encrypt) {
191 // Open array.
192 std::unique_ptr<Array> array;
193 if (encrypt) {
194 array = std::make_unique<Array>(
195 ctx_,
196 SPARSE_ARRAY_NAME,
197 TILEDB_READ,
198 TemporalPolicy(TimeTravel, timestamp),
199 EncryptionAlgorithm(AESGCM, key_.c_str()));
200 } else {
201 array = std::make_unique<Array>(
202 ctx_,
203 SPARSE_ARRAY_NAME,
204 TILEDB_READ,
205 TemporalPolicy(TimeTravel, timestamp));
206 }
207 auto array_ptr = array->ptr();
208
209 // Load delete conditions.
210 auto&& [conditions, update_values] = load_delete_and_update_conditions(
211 ctx_.ptr().get()->resources(), *array_ptr->opened_array().get());
212 REQUIRE(conditions.size() == qcs.size());
213
214 for (uint64_t i = 0; i < qcs.size(); i++) {
215 // Compare to negated condition.
216 auto cmp = qcs[i].ptr()->query_condition_->negated_condition();
217 CHECK(tiledb::test::ast_equal(conditions.at(i).ast(), cmp.ast()));
218 auto& loaded_update_values = update_values.at(i);
219 for (uint64_t j = 0; j < uvs[i].size(); j++) {
220 CHECK(uvs[i][j].field_name() == loaded_update_values[j].field_name());
221 }
222 }
223
224 array->close();
225}
226
227void UpdatesFx::remove_array(const std::string& array_name) {
228 if (!is_array(array_name))

Callers

nothing calls this directly

Calls 14

TemporalPolicyClass · 0.85
EncryptionAlgorithmClass · 0.85
ast_equalFunction · 0.85
c_strMethod · 0.80
resourcesMethod · 0.80
negated_conditionMethod · 0.80
ptrMethod · 0.45
getMethod · 0.45
opened_arrayMethod · 0.45
sizeMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected