Skip to content
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: fix the incorrect assertion for fixed size binary decoder #3050

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

niyue
Copy link
Contributor

@niyue niyue commented Oct 26, 2024

This PR tries to fix #3049

It fixes the incorrect assertion for fixed size binary decoder and add a test to verify fixed size binary decoder works.

Copy link

ACTION NEEDED
Lance follows the Conventional Commits specification for release automation.

The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification.

For details on the error please inspect the "PR Title Check" action.

@niyue niyue force-pushed the bugfix/fixed-width-binary-encoder branch from cfa354b to dffa4d8 Compare October 26, 2024 10:10
@niyue niyue changed the title Fix the incorrect assertion for fixed size binary decoder fix: fix the incorrect assertion for fixed size binary decoder Oct 26, 2024
@github-actions github-actions bot added the bug Something isn't working label Oct 26, 2024
@@ -84,7 +84,7 @@ impl PrimitivePageDecoder for FixedSizeBinaryDecoder {
let num_bytes = num_rows * self.byte_width;
let bytes = self.bytes_decoder.decode(rows_to_skip, num_bytes)?;
let bytes = bytes.as_fixed_width().unwrap();
debug_assert_eq!(bytes.bits_per_value, 8);
debug_assert_eq!(bytes.bits_per_value, self.byte_width * 8);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This decoder will be used if Lance format 2.1 is enabled and this assertion will fail for some input data.

@codecov-commenter
Copy link

codecov-commenter commented Oct 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.42%. Comparing base (c9cabc1) to head (0bc992d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3050      +/-   ##
==========================================
+ Coverage   78.40%   78.42%   +0.02%     
==========================================
  Files         240      240              
  Lines       78593    78637      +44     
  Branches    78593    78637      +44     
==========================================
+ Hits        61617    61669      +52     
+ Misses      13851    13825      -26     
- Partials     3125     3143      +18     
Flag Coverage Δ
unittests 78.42% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…test to verify the fixed size binary decoder really works.
@niyue niyue force-pushed the bugfix/fixed-width-binary-encoder branch from dffa4d8 to 0bc992d Compare October 28, 2024 03:21
Copy link
Contributor

@broccoliSpicy broccoliSpicy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@broccoliSpicy broccoliSpicy merged commit 05344cf into lancedb:main Oct 28, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect assertion for fixed width binary decoder in Lance 2.1
3 participants