Getting the Fragment Info

A write operation can create one or more fragments. You can get information about the written fragments as follows:

C
C++
Python
R
Java
Go
C
// ... create context ctx
// ... create query
// Get the number of written fragments
unsigned int num;
tiledb_query_get_fragment_num(ctx, query, &num);
// Get the fragment URI by index (0 <= idx < num)
const char* uri;
tiledb_query_get_fragment_uri(ctx, query, idx, &uri);
// Get the timestamp range by index (0 <= idx < num)
unsigned long long t1, t2;
tiledb_query_get_fragment_timestamp_range(ctx, query, idx, &t1, &t2);
C++
// ... create query
// Get the number of written fragments
uint32_t num = query.fragment_num();
// Get the fragment URI by index (0 <= idx < num)
std::string uri = query.fragment_uri(idx);
// Get the timestamp range by index (0 <= idx < num)
std::pair<uint64_t, uint64_t> range = query.get_fragment_timestamp_range(idx);
Python
with tiledb.DenseArray(array_name, 'w') as A:
A[:] = data
# returns a dict of {filename: (timestamp1,timestamp2)}
print(A.last_write_info)
R
## continuing from previous example on dense variable length array
## (but this works of course with any array after a write is needed
## number of fragments
numfrag <- tiledb:::libtiledb_query_get_fragment_num(qryptr)
## URI of given fragment
uritxt <- tiledb:::libtiledb_query_get_fragment_uri(qryptr, 0)
##TODO Higher-level R support
Java
// TODO: Currently not supported in Java
Go
// TODO: Currently not supported in Go