TileDB icon indicating copy to clipboard operation
TileDB copied to clipboard

Allow zero-sized buffers to be set to read queries

Open stavrospapadopoulos opened this issue 7 years ago • 2 comments

Although it is not useful to set a zero-sized buffer to a read query, from a correctness standpoint it should still be doable. Also in case the result is empty (e.g., in sparse arrays), the query must gracefully complete, rather than being marked as incomplete.

cc @prakhar0402

stavrospapadopoulos avatar Sep 19 '18 15:09 stavrospapadopoulos

A related issue is that it would be nice to support passing a vector which is pre-allocated with std::vector::reserve. Passing such a vector to set_buffer currently fails in the same way as a true zero-element buffer, because we check buf.size() rather than buf.capacity(). (maybe that change is simple enough to do separately on its own, but I'm not sure if there would be any broader implications)

ihnorton avatar Mar 20 '19 18:03 ihnorton

@ihnorton for the C++ API I don't think we can use buf.capacity() for the check, as there's no way for us to set the size of a std::vector after reading elements into its backing memory (without overwriting).

tdenniston avatar Jun 05 '19 12:06 tdenniston