Parquet: Handle decimal and UUID literals in filter pushdown#16051
Open
laserninja wants to merge 1 commit intoapache:mainfrom
Open
Parquet: Handle decimal and UUID literals in filter pushdown#16051laserninja wants to merge 1 commit intoapache:mainfrom
laserninja wants to merge 1 commit intoapache:mainfrom
Conversation
Fix ParquetFilters.getParquetPrimitive() throwing UnsupportedOperationException for BigDecimal and UUID values. For decimals, the fix routes predicates through the correct Parquet column type based on precision: INT32 (precision <= 9), INT64 (precision <= 18), or FIXED_LEN_BYTE_ARRAY (precision > 18), matching how TypeToMessageType stores decimal values. For UUIDs, the fix converts UUID values to 16-byte Binary via UUIDUtil.convert() in getParquetPrimitive(). Closes apache#16035
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
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.
Summary
Handle
BigDecimalandUUIDliteral types inParquetFiltersto enable filter pushdown for decimal and UUID predicates.Problem
Closes #16035
ParquetFilters.getParquetPrimitive()throwsUnsupportedOperationExceptionforBigDecimalandUUIDvalues. Additionally, decimal predicates were always routed throughbinaryColumn()regardless of precision, producing incorrect Parquet filter predicates for decimals that are stored as INT32 or INT64.Solution
intColumnfor precision ≤ 9 (stored as INT32)longColumnfor precision ≤ 18 (stored as INT64)binaryColumnfor precision > 18 (stored as FIXED_LEN_BYTE_ARRAY)getDecimalAsInt(),getDecimalAsLong(), andgetDecimalAsBinary()for the conversionsUUIDUtil.convert()to 16-byteBinaryingetParquetPrimitive()Testing
./gradlew :iceberg-parquet:test)TestParquetFilterswith 10 tests covering:./gradlew spotlessApplypassesNote: This contribution was AI-assisted. The implementation logic and design decisions were reviewed and verified by the author.