Mismatching Cell Num for Subarray


#1

Hey all,

I am running into an issue where if I’m trying to write a subarray using the C++ API, it’s telling me that the number of expected cells is not equal to the actual number of cells. The trick is that I’m only trying to read the first 5 values in the array, so my subarray looks like this:

  std::vector<uint64_t> subarray = {0, 0, 0, 4};

Am I running into issues because I’m only accessing the 0th row? The rest of my query looks like this:

tiledb::Query md_write(_ctx, array, TILEDB_WRITE);
md_write.set_subarray(subarray);
md_write.set_layout(TILEDB_ROW_MAJOR);
md_write.set_buffer("data", img_values);

where img_values is a vector of 5 values.

Thanks!


#2

Hi Christina,

Is data the only attribute in your array? When writing in TileDB, you must provide values for all attributes.

Tyler


#3

Yes, I only have one attribute.

I should probably also mention I’m on v1.3.1 right now


#4

Ah, I found my issue. I had the number of values per cell reversed (not entirely sure how I managed that, but at least I found it!)

Thank you!


#5

Great, glad you found it!