Skip to content

Comments

feat: Support int to timestamp casts#3541

Merged
andygrove merged 7 commits intoapache:mainfrom
coderfender:support_int_to_timestamp_casts
Feb 19, 2026
Merged

feat: Support int to timestamp casts#3541
andygrove merged 7 commits intoapache:mainfrom
coderfender:support_int_to_timestamp_casts

Conversation

@coderfender
Copy link
Contributor

@coderfender coderfender commented Feb 17, 2026

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 on collect()

Code to reproduce error :
spark.sql("SELECT cast(-9223372036854775808 as timestamp)").collect()

@coderfender coderfender force-pushed the support_int_to_timestamp_casts branch from 6bec627 to 11ef1b6 Compare February 17, 2026 01:03
@coderfender
Copy link
Contributor Author

I believe this is ready for your review @andygrove

@coderfender coderfender force-pushed the support_int_to_timestamp_casts branch from 7859888 to 464cce2 Compare February 18, 2026 03:21
@coderfender
Copy link
Contributor Author

Thank you for merging main and the suggestions re testing long to timestamp @andygrove , @mbutrovich

@coderfender coderfender force-pushed the support_int_to_timestamp_casts branch from 427d3b6 to fbacef0 Compare February 18, 2026 18:44
Copy link
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @coderfender. This looks good. Could you fill out the PR description/?

@coderfender
Copy link
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).

Copy link
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @coderfender!

@andygrove andygrove merged commit 219859b into apache:main Feb 19, 2026
113 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native support Int to Timestamp cast

2 participants