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

Function write_array2

examples/cpp_api/array_schema_evolution.cc:80–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void write_array2(const Context& ctx) {
81 // Write some simple data to cells (1, 1), (2, 4) and (2, 3).
82 std::vector<int> coords_rows = {3};
83 std::vector<int> coords_cols = {1};
84 std::vector<int> a_data = {4};
85 std::vector<uint32_t> b_data = {4};
86
87 // Open the array for writing and create the query.
88 Array array(ctx, array_uri, TILEDB_WRITE);
89 Query query(ctx, array, TILEDB_WRITE);
90 query.set_layout(TILEDB_UNORDERED)
91 .set_data_buffer("a", a_data)
92 .set_data_buffer("b", b_data)
93 .set_data_buffer("rows", coords_rows)
94 .set_data_buffer("cols", coords_cols);
95
96 // Perform the write and close the array.
97 query.submit();
98 array.close();
99}
100
101void read_array(const Context& ctx) {
102 // Prepare the array for reading

Callers 1

mainFunction · 0.85

Calls 4

set_data_bufferMethod · 0.45
set_layoutMethod · 0.45
submitMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected