Skip to content

Fix write queries using sm.var_offsets.extra_element=true. #5033

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 11, 2024

Conversation

rroelke
Copy link
Member

@rroelke rroelke commented May 31, 2024

Story details: https://app.shortcut.com/tiledb-inc/story/48614

The write query uses coords_info_.coords_num_ as a stand-in for the number of cells in the write query input. This value is computed as *buffer_offsets_size / constants::cell_var_offset_size, which makes sense for the traditional tiledb input where the number of offsets is the same as the number of cells.

The configuration sm.var_offsets.extra_element, however, breaks that assumption. This option is useful for arrow compatibility but also simplifies upstream code - we want to use it in tiledb-rs, for example. When this option is used, coords_num_ must be adjusted accordingly. Previously it was not, and now it is.

The added unit test demonstrates that if num_coords_ is not adjusted, then the unordered writer finds an extra "empty" element at the end. This results in a duplicate coordinate if there is an actual empty element.

In addition to the unit test, the branch trying to use this feature in tiledb-rs passes its property-based testing when linking against this branch of core.


TYPE: BUG
DESC: Fix write queries using sm.var_offsets.extra_element=true

@rroelke rroelke requested a review from ypatia May 31, 2024 18:55
@rroelke rroelke force-pushed the rr/sc-48614-write-extra-offsets-empty-coordinate branch from d97bc10 to e44e400 Compare May 31, 2024 18:59
@ypatia ypatia requested review from KiterLuc and removed request for ypatia June 4, 2024 13:07
@KiterLuc KiterLuc changed the title fix: [sc-48614] With configuration "sm.var_offsets.extra_element = true", write to variable-length dimension fails Fix write queries using sm.var_offsets.extra_element=true. Jun 11, 2024
@KiterLuc KiterLuc merged commit 5e38730 into dev Jun 11, 2024
60 of 62 checks passed
@KiterLuc KiterLuc deleted the rr/sc-48614-write-extra-offsets-empty-coordinate branch June 11, 2024 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants