| 262 | } |
| 263 | |
| 264 | void write_dense_array( |
| 265 | Context ctx, |
| 266 | const std::string& array_name, |
| 267 | std::vector<int32_t>& data, |
| 268 | std::vector<uint64_t>& data_offsets, |
| 269 | tiledb_layout_t layout, |
| 270 | shared_ptr<Config> config = nullptr) { |
| 271 | std::vector<int64_t> d1 = {1, 1, 2, 2}; |
| 272 | std::vector<int64_t> d2 = {1, 2, 1, 2}; |
| 273 | |
| 274 | Array array(ctx, array_name, TILEDB_WRITE); |
| 275 | Query query(ctx, array, TILEDB_WRITE); |
| 276 | |
| 277 | if (config != nullptr) { |
| 278 | query.set_config(*config); |
| 279 | |
| 280 | // Validate we can retrieve set config |
| 281 | Config config2 = query.config(); |
| 282 | bool same = *config == config2; |
| 283 | CHECK(same == true); |
| 284 | } |
| 285 | |
| 286 | query.set_data_buffer("attr", data); |
| 287 | query.set_offsets_buffer("attr", data_offsets); |
| 288 | query.set_layout(layout); |
| 289 | if (layout == TILEDB_UNORDERED) { |
| 290 | // sparse write to dense array |
| 291 | query.set_data_buffer("d1", d1); |
| 292 | query.set_data_buffer("d2", d2); |
| 293 | } else { |
| 294 | query.set_subarray( |
| 295 | Subarray(ctx, array).set_subarray<int64_t>({1, 2, 1, 2})); |
| 296 | } |
| 297 | |
| 298 | // Submit query |
| 299 | if (layout == TILEDB_GLOBAL_ORDER) { |
| 300 | query.submit_and_finalize(); |
| 301 | } else { |
| 302 | query.submit(); |
| 303 | } |
| 304 | |
| 305 | array.close(); |
| 306 | } |
| 307 | |
| 308 | void write_dense_array( |
| 309 | Context ctx, |
nothing calls this directly
no test coverage detected