chore: replace legacy datetime rebase tests with current scan coverage [iceberg]#3605
Draft
andygrove wants to merge 7 commits intoapache:mainfrom
Draft
chore: replace legacy datetime rebase tests with current scan coverage [iceberg]#3605andygrove wants to merge 7 commits intoapache:mainfrom
andygrove wants to merge 7 commits intoapache:mainfrom
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?
N/A
Rationale for this change
The original motivation for this PR was to:
ParquetDatetimeRebaseSuite, because all tests are ignored and are specific to thenative_cometscan, which no longer exists.COMET_EXCEPTION_ON_LEGACY_DATE_TIMESTAMPworks correctly withnative_iceberg_compatHowever, I discovered that
COMET_EXCEPTION_ON_LEGACY_DATE_TIMESTAMPhas no effect because there is a dead code path. Therefore, I added a new test to confirm current behavior and updated the docs.Although
CometParquetFileFormat.getDatetimeRebaseSpec()is called and the config was read, the resultinguseLegacyDateTimestampflag is passed toNativeColumnReader, which overridesinitNative()and does not callUtils.initColumnReader(). The flag was stored but never acted upon — the pre-1582 date check in the Rust column decoder (values.rs) was never reached.Note that
COMET_EXCEPTION_ON_LEGACY_DATE_TIMESTAMPmay still be respected by the Iceberg integration.What changes are included in this PR?
CometConf.scala: RemovedCOMET_EXCEPTION_ON_LEGACY_DATE_TIMESTAMPCometParquetFileFormat.scala: Removed config propagation to Hadoop conf. SimplifiedgetDatetimeRebaseSpec()to always set CORRECTED mode when LEGACY is detected (no conditional, no warning log).parquet_scans.md: Removed reference to the deleted config. Simplified the rebasing limitation description.ParquetReadSuite.scala: Added test "reading ancient dates before 1582" that reads a Parquet file written by Spark 3.2.0 withorg.apache.spark.legacyDateTimemetadata, verifies the plan uses Comet operators, and confirms all 8 rows with pre-1582 dates are read successfully.How are these changes tested?