[SPARK-54203][SQL] Support TimeType in RowToColumnConverter#56613
Open
MaxGekk wants to merge 2 commits into
Open
[SPARK-54203][SQL] Support TimeType in RowToColumnConverter#56613MaxGekk wants to merge 2 commits into
MaxGekk wants to merge 2 commits into
Conversation
### What changes were proposed in this pull request? Add a `TimeType` branch (via the abstract `AnyTimeType`) to `RowToColumnConverter.getConverterForType` in `Columnar.scala`, routing TIME columns through the long-backed `LongConverter` path. TIME is stored as nanos-of-day `Long`, and the on/off-heap column vectors already reserve long storage for it, so no vector changes are required. ### Why are the changes needed? Previously `getConverterForType` had no `TimeType` case, so a TIME column fell through to `unsupportedDataTypeError`, blocking row-to-column conversion paths (RowToColumnar transitions, vectorized execution, etc.) for TIME. ### Does this PR introduce any user-facing change? No. It enables an existing code path for the TIME data type. ### How was this patch tested? Added round-trip and null-handling tests for `TimeType` to `RowToColumnConverterSuite`. Ran `build/sbt 'sql/testOnly *RowToColumnConverterSuite'` (all 13 tests pass) and scalastyle on the sql module (0 errors).
…spatch Use `_: TimeType` instead of the abstract `_: AnyTimeType` in the long-backed branch of `getConverterForType`, matching every peer long-backed dispatch site and keeping a future non-long-backed time subtype on the explicit `unsupportedDataTypeError` path. Co-authored-by: Isaac
uros-b
approved these changes
Jun 19, 2026
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?
Add a
TimeTypebranch (via the abstractAnyTimeType) toRowToColumnConverter.getConverterForTypeinsql/core/.../execution/Columnar.scala, routing TIME columns through the long-backedLongConverterpath. TIME is stored as nanos-of-dayLong, and the on/off-heap column vectors already reserve long storage for it (OnHeapColumnVector,OffHeapColumnVector), so no column-vector changes are required.Why are the changes needed?
Previously
getConverterForTypehandledLongType | TimestampType | TimestampNTZType | DayTimeIntervalType(all long-backed) but had noTimeTypecase, so a TIME column fell through tounsupportedDataTypeError. This blocked row-to-column conversion paths (e.g.RowToColumnartransitions, vectorized execution) for the TIME data type.This is a sub-task of SPARK-57550 (Extend support for the TIME data type).
Does this PR introduce any user-facing change?
No. It enables an existing code path for the TIME data type that previously threw an unsupported-type error.
How was this patch tested?
Added round-trip and null-handling tests for
TimeTypetoRowToColumnConverterSuite:TimeType column roundtrip(precisions 0, 3, 6; values including0Land end-of-day86399999999999L)TimeType column with nullsRan
build/sbt 'sql/testOnly *RowToColumnConverterSuite'(all 13 tests pass) and scalastyle on the sql module (0 errors).Was this patch authored or co-authored using generative AI tooling?
Yes, Generated-by: Cursor.