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

Method create_array_and_write_fragments

test/src/test-cppapi-aggregates.cc:549–616  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

547
548template <class T>
549void CppAggregatesFx<T>::create_array_and_write_fragments() {
550 if (dense_) {
551 create_dense_array();
552
553 optional<std::vector<uint8_t>> validity_full = nullopt;
554 optional<std::vector<uint8_t>> validity_single = nullopt;
555 optional<std::vector<uint8_t>> validity_two_full = nullopt;
556 if (nullable_) {
557 validity_full = {1, 0, 1, 0, 1, 0, 1, 0, 1};
558 validity_single =
559 std::make_optional<std::vector<uint8_t>>(std::vector<uint8_t>({1}));
560 validity_two_full = {
561 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0};
562 }
563
564 // Write first tile.
565 write_dense({0, 1, 2, 3, 4, 5, 6, 7, 8}, 1, 3, 1, 3, 1, validity_full);
566
567 // Write second tile.
568 write_dense(
569 {9, 10, 11, 12, 255, 14, 15, 16, 17}, 1, 3, 4, 6, 3, validity_full);
570
571 // Overwrite single value in second tile. This will create overlapping
572 // fragment domains.
573 write_dense({13}, 2, 2, 5, 5, 5, validity_single);
574
575 // Write third and fourth tile.
576 write_dense(
577 {18,
578 19,
579 20,
580 21,
581 22,
582 23,
583 24,
584 25,
585 26,
586 27,
587 28,
588 29,
589 30,
590 31,
591 32,
592 33,
593 34,
594 35},
595 4,
596 6,
597 1,
598 6,
599 7,
600 validity_two_full);
601 } else {
602 create_sparse_array();
603
604 // Write fragments, only cell 3,3 is duplicated.
605 optional<std::vector<uint8_t>> validity_values = nullopt;
606 if (nullable_) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected