You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Parquet bloom filter pruning can incorrectly filter decimals encoded as FIXED_LEN_BYTE_ARRAY (#22995)
## Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax. For example
`Closes#123` indicates that this PR will close issue #123.
-->
- Closes#22994.
## Rationale for this change
Parquet bloom filter pruning can incorrectly prune decimal columns
encoded as `FIXED_LEN_BYTE_ARRAY`.
Bloom filters are checked against the physical bytes stored in the
Parquet file. For `FIXED_LEN_BYTE_ARRAY`, the byte width comes from the
Parquet column descriptor's `type_length`. DataFusion was checking
decimal literals using a fixed-width integer byte representation, which
can differ from thefile's fixed byte width and cause false negatives.
## What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->
- Carry the Parquet column `type_length` together with the bloom filter
metadata.
- Use `type_length` when checking decimal literals against
`FIXED_LEN_BYTE_ARRAY` bloom filters.
- Fall back to conservative pruning behavior when the fixed byte length
cannot be represented safely.
- Add a regression test for fixed-length decimal bloom filter pruning.
## Are these changes tested?
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?
-->
Yes.
## Are there any user-facing changes?
No API changes. This fixes incorrect query results when Parquet bloom
filter pruning is enabled for fixed-length decimal columns.
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.
-->
<!--
If there are any breaking changes to public APIs, please add the `api
change` label.
-->
0 commit comments