Add support for additional numeric types in to_timestamp functions#19663
Merged
Jefffrey merged 10 commits intoapache:mainfrom Jan 11, 2026
Merged
Add support for additional numeric types in to_timestamp functions#19663Jefffrey merged 10 commits intoapache:mainfrom
Jefffrey merged 10 commits intoapache:mainfrom
Conversation
Jefffrey
reviewed
Jan 6, 2026
Contributor
Jefffrey
left a comment
There was a problem hiding this comment.
Thanks for picking this up; I think we should ensure we support Float16 and all the other decimal variants too, for completeness
martin-g
reviewed
Jan 6, 2026
martin-g
reviewed
Jan 7, 2026
Contributor
|
Thanks for submitting this PR @gokselk, much appreciated. |
03c1937 to
1a2facb
Compare
Omega359
reviewed
Jan 7, 2026
Jefffrey
reviewed
Jan 8, 2026
Jefffrey
approved these changes
Jan 9, 2026
Contributor
de-bgunter
pushed a commit
to de-bgunter/datafusion
that referenced
this pull request
Mar 24, 2026
…pache#19663) ## Which issue does this PR close? Closes apache#19117. ## Rationale for this change The `to_timestamp` function family lacks consistency in supported argument types. While `to_timestamp` accepts Float64 and Decimal128 types, the related functions (`to_timestamp_seconds`, `to_timestamp_millis`, `to_timestamp_micros`, `to_timestamp_nanos`) don't offer the same support. Additionally, the documentation claims support for "unsigned integer" types, but this isn't fully implemented. ## What changes are included in this PR? Standardizes all `to_timestamp` variants to uniformly support: - All signed integer types: Int8, Int16, Int32, Int64 - All unsigned integer types: UInt8, UInt16, UInt32, UInt64 - Float32 and Float64 - Decimal128 (for millis/micros/nanos variants) ## Are these changes tested? Yes, added comprehensive SQL logic tests in `datafusion/sqllogictest/test_files/datetime/timestamps.slt`. ## Are there any user-facing changes? Users can now pass additional numeric types to `to_timestamp` functions. This is a backward-compatible enhancement.
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 #19117.
Rationale for this change
The
to_timestampfunction family lacks consistency in supported argument types. Whileto_timestampaccepts Float64 and Decimal128 types, the related functions (to_timestamp_seconds,to_timestamp_millis,to_timestamp_micros,to_timestamp_nanos) don't offer the same support. Additionally, the documentation claims support for "unsigned integer" types, but this isn't fully implemented.What changes are included in this PR?
Standardizes all
to_timestampvariants to uniformly support:Are these changes tested?
Yes, added comprehensive SQL logic tests in
datafusion/sqllogictest/test_files/datetime/timestamps.slt.Are there any user-facing changes?
Users can now pass additional numeric types to
to_timestampfunctions. This is a backward-compatible enhancement.