[SPARK-56804][SQL] Add bulk read+convert path for DATE to TimestampNTZ Parquet vector updater#55855
Draft
LuciferYang wants to merge 4 commits into
Draft
[SPARK-56804][SQL] Add bulk read+convert path for DATE to TimestampNTZ Parquet vector updater#55855LuciferYang wants to merge 4 commits into
LuciferYang wants to merge 4 commits into
Conversation
…Z Parquet vector updater
22660e6 to
eaf396f
Compare
…uet.ParquetVectorUpdaterBenchmark (JDK 17, Scala 2.13, split 1 of 1)
…uet.ParquetVectorUpdaterBenchmark (JDK 21, Scala 2.13, split 1 of 1)
…uet.ParquetVectorUpdaterBenchmark (JDK 25, Scala 2.13, split 1 of 1)
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.
What changes were proposed in this pull request?
Extend the bulk read+convert pattern introduced in SPARK-56791 to
DateToTimestampNTZUpdater(parquet INT32 DATE read into a SparkTimestampNTZTypeat UTC, CORRECTED rebase mode).A new
readIntegersAsTimestampMicrosdefault method onVectorizedValuesReaderdoes the per-row fallback.VectorizedPlainValuesReaderoverrides it to fetch source bytes once viagetBuffer(total * 4)and run a tight in-method conversion loop.DateToTimestampNTZUpdater.readValuesbecomes a one-line delegation. The per-element conversion isDateTimeUtils.daysToMicros(days, ZoneOffset.UTC), matching the per-row Updater's exact semantics including theMath.multiplyExactoverflow check. TheLEGACY/EXCEPTIONrebase variants (handled byDateToTimestampNTZWithRebaseUpdater) are out of scope.Unlike the pure-primitive-cast siblings (SPARK-56791/56801/56802), the per-element conversion here is a function call rather than a JVM-native widen, so the expected speedup is smaller; the win still comes from collapsing N
getBuffer(4)allocations into one.Why are the changes needed?
DateToTimestampNTZUpdater.readValuesallocates a freshByteBufferslice insidegetBuffer(4)for every element on the legacy path. Collapsing N allocations into one is the same win SPARK-56791 delivered for the INT32 -> Long sibling.Does this PR introduce any user-facing change?
No.
How was this patch tested?
(To be updated after the GHA benchmark and test runs complete.)
Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code