-
Notifications
You must be signed in to change notification settings - Fork 1k
Arrow-Parquet SBBF coercion #8551
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
Open
mr-brobot
wants to merge
17
commits into
apache:main
Choose a base branch
from
mr-brobot:feat/parquet/arrow-sbbf
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or 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
mr-brobot
commented
Oct 4, 2025
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.
Benchmark | Sbbf |
ArrowSbbf |
Delta |
---|---|---|---|
i8 |
1.51 ns | 7.38 ns | +5.87 ns |
i32 |
3.86 ns | 7.15 ns | +3.29 ns |
Decimal128(5,2) |
1.73 ns | 7.69 ns | +5.96 ns |
Decimal128(15,2) |
1.73 ns | 8.20 ns | +6.48 ns |
Decimal128(30,2) |
1.73 ns | 5.85 ns | +4.12 ns |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Which issue does this PR close?
Rationale for this change
Parquet types are a subset of Arrow types, so the Arrow writer must coerce to Parquet types. In some cases, this changes the physical representation. Therefore, passing Arrow data directly to
Sbbf::check
will produce false negatives. Correctness is only guaranteed when checking with the coerced Parquet value.This issue affects some integer and decimal types. It can also affect
Date64
.What changes are included in this PR?
Introduces
ArrowSbbf
as an Arrow-aware interface to the ParquetSbbf
. This coerces incoming data if necessary and callsSbbf::check
.Currently,
Date64
types can be written as eitherINT32
(days since epoch) orINT64
(milliseconds since epoch), depending on Arrow writer properties (coerce_types
). Instead of requiring additional information to handle this special (non-default) case, this implementation instructs users to coerceDate64
toDate32
if the Parquet column type isINT32
. I'm open to feedback on this decision.Are these changes tested?
There are tests for integer, float, decimal, and date types. Not exhaustive but covering all cases where coercion is necessary.
Are there any user-facing changes?
There is a new
ArrowSbbf
struct that most Arrow users should prefer over usingSbbf
directly. Also, theSized
constraint was relaxed on theSbbf::check
function to support slices. This is consistent withSbbf::insert
.