feat: add native Parquet datetime rebasing - #5047
Draft
peterxcli wants to merge 2 commits into
Draft
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
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?
Closes #5010.
Rationale for this change
Native Parquet scans did not apply Spark's legacy Julian/Gregorian datetime rebasing. Files written by Spark 2.x or with a
LEGACYwrite mode could therefore return shifted ancientDATEandTIMESTAMPvalues. Rebasing only final output is insufficient because Parquet predicates and native filters or aggregates can consume the encoded values first.Spark resolves rebasing separately for every file, with footer metadata taking precedence over reader configuration. Comet needs the same behavior to keep native scans correct for legacy, corrected, and mixed-file inputs.
What changes are included in this PR?
DATE,TIMESTAMP_MILLIS,TIMESTAMP_MICROS, and INT96 values before native filtering and aggregation.EXCEPTIONmode.How are these changes tested?
make corecargo fmt --all -- --checkcargo clippy --all-targets --workspace -- -D warningscargo test -p datafusion-comet datetime_rebase --no-default-features./mvnw test -Dtest=none '-Dsuites=org.apache.comet.parquet.ParquetReadV1Suite native scan rebases legacy' -Dscalastyle.skip=true./mvnw test -Dtest=none '-Dsuites=org.apache.comet.parquet.ParquetReadV1Suite native scan honors per-file datetime rebase modes' -Dscalastyle.skip=true./mvnw test -Dtest=none '-Dsuites=org.apache.spark.sql.comet.PlanDataInjectorSuite native scan injector records the executor JVM timezone' -Dscalastyle.skip=true