-
Notifications
You must be signed in to change notification settings - Fork 186
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
Fix support for empty strings for Dictionary and RLE encodings #3938
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7c431fa
Fix checks and dict for empty strings
ypatia c0fe06f
Fix rle tests failing CI, but not dictionary ones
ypatia 5885399
Address @davisp's review comments
ypatia 72925e5
Reconstruct offsets for the all empty string case
ypatia 363cd1a
Test commit
davisp 76bbfbd
Fix RLE for empty strings
ypatia a8fed71
Don't rely on memcpy no-op
davisp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having just read the code, I'm pretty sure the removal of checking
output.empty()
here and indict_compressor.h:186
is the entire fix for the issue.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, there are 2 reasons those 2 checks are not enough:
deserialize_dictionary
, if I have an empty string as entry, I am not properly incrementing the index to theserialized_dictionary
(in_index
) indict_compressor.h:261
and I am accessing out of bounds. I special-cased forstr_len = 0
there and reverted the rest of the changes, can you check if you like that solution or you have a better idea on how to handle that?decompress
I still need the special case foroutput.empty()
indict_compressor.h:193
because otherwise I get aSIGABRT
because I am violating a contract of the implementation ofspan
we are using that assumes that when writing to aspan
at some indexidx
:TCB_SPAN_EXPECT(idx < size());
, and in case of an emptyoutput
we get a failing0 < 0
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My fix is still not correct for the all empty strings case because of the last special case I mentioned where I exit
if output.empty()
, because I don't reconstruct theoffsets_buffer
. If I do reconstruct them I get a heap buffer overflow though, I am still fighting it to understand why.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yeah, that span behavior is odd since we're indexing with a zero length array. How does this approach look to you?
https://github.com/TileDB-Inc/TileDB/compare/pd/ch25823/support_for_empty_strings_dict_rle
Locally it passes the new test with
--enable-debug --enable-assertions
on the bootstrap line. I haven't run a full test suite with it though.