Fix parquet predicate pushdown for INT96 timestamp values#5083
Merged
martint merged 1 commit intotrinodb:masterfrom Sep 4, 2020
Merged
Fix parquet predicate pushdown for INT96 timestamp values#5083martint merged 1 commit intotrinodb:masterfrom
martint merged 1 commit intotrinodb:masterfrom
Conversation
Added in prestosql#4104, predicate pushdown for parquet INT96 timestamp values can result in incorrect results even when stats appear valid by checking min <= max. Parquet writers that produced statistics at all were comparing min and max values as BINARY which is oblivious to the semantics of how INT96 timestamps are encoded making them unusable. Comparison of INT96 values for statistics was removed in PARQUET-1065 for all cases except when min == max, which would not be affected by the comparison issue or other byte order issues that existed with parquet BINARY types at the time. Any parquet file that contains INT96 statistics where min != max would have to have been written by an older parquet writer that compared the values incorrectly, making those statistics unusable. This change disables parquet predicate pushdown on INT96 timestamps except for when all rows have the same value (ie: min == max).
32a0afe to
18aedf5
Compare
martint
approved these changes
Sep 4, 2020
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.
Added in prestosql#4104, predicate pushdown for parquet INT96 timestamp values can result in incorrect results even when stats appear valid by checking min <= max. Parquet writers that produced statistics at all were comparing min and max values as BINARY which is oblivious to the semantics of how INT96 timestamps are encoded making them unusable.
Comparison of INT96 values for statistics was removed in PARQUET-1065 for all cases except when min == max, which would not be affected by the comparison issue or other byte order issues that existed with parquet BINARY types at the time. Any parquet file that contains INT96 statistics where min != max would have to have been written by an older parquet writer that compared the values incorrectly, making those statistics unusable.
This change disables parquet predicate pushdown on INT96 timestamps except for when all rows have the same value (min == max).