feat: Support int to timestamp casts#3541
Merged
andygrove merged 7 commits intoapache:mainfrom Feb 19, 2026
Merged
Conversation
6bec627 to
11ef1b6
Compare
coderfender
commented
Feb 17, 2026
Contributor
Author
|
I believe this is ready for your review @andygrove |
andygrove
reviewed
Feb 17, 2026
andygrove
reviewed
Feb 17, 2026
andygrove
reviewed
Feb 17, 2026
andygrove
reviewed
Feb 17, 2026
7859888 to
464cce2
Compare
Contributor
Author
|
Thank you for merging main and the suggestions re testing long to timestamp @andygrove , @mbutrovich |
427d3b6 to
fbacef0
Compare
andygrove
reviewed
Feb 19, 2026
Member
andygrove
left a comment
There was a problem hiding this comment.
Thanks @coderfender. This looks good. Could you fill out the PR description/?
Contributor
Author
|
Thank you for the review @andygrove. I filled out the description (sorry for the miss on my end and thank you for pointing that out). |
andygrove
reviewed
Feb 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.
Which issue does this PR close?
Closes #3550 .
Rationale for this change
What changes are included in this PR?
Native support from Int /Long to Timestamp casts. Following spark's approach, we saturate to Long MIN / MAX values in all Eval Modes.
How are these changes tested?
Enable unit tests (Short/ Byte/ Int/ Long -> Timestamp etc) in
CometCastSuite.scala. One additional thing we had to to was to perform cast (cast (long) as timestamp) since super large timestamps caused error oncollect()Code to reproduce error :
spark.sql("SELECT cast(-9223372036854775808 as timestamp)").collect()