Repository navigation
fix: preserve input strictness in from_unixtime - #26414
Merged
jayzhan211 merged 2 commits intoOct 18, 2026
Merged
Conversation
from_unixtime
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #26414 +/- ##
==========================================
- Coverage 82.89% 82.88% -0.01%
==========================================
Files 1153 1153
Lines 457487 457487
Branches 457487 457487
==========================================
- Hits 379213 379200 -13
- Misses 55264 55274 +10
- Partials 23010 23013 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jayzhan211
approved these changes
Oct 18, 2026
jayzhan211
left a comment
Contributor
There was a problem hiding this comment.
Thanks @haohuaijin , LGTM
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 18, 2026
Contributor
Author
|
Thanks for your reviews @jayzhan211 , i checked the merge queue fail, look like merge queue itself have some issue, need you help to enqueue again. |
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?
Found while reviewing #26111; no separate issue. This fix is independent of that PR.
Rationale for this change
from_unixtime(CAST(seconds AS BIGINT))could incorrectly eliminate a multi-key sort. Ordered input rows(seconds, id) = (1.1, 1), (1.9, 0)produce the same timestamp, but the IDs must be reordered to0, 1.What changes are included in this PR?
Propagate the first argument's strict ordering property instead of unconditionally returning
true.What is the testing strategy for this PR?
Three compact SQL cases in
datetime/timestamps.sltcheck the result ordering with and without a timezone, including NULLs, and verify that direct integer inputs still avoid an extra sort. The two regression cases fail without the fix.Validated with the targeted SQL test file, all 10
from_unixtimeunit tests, formatting, andgit diff --check.Are there any user-facing changes?
Yes. Queries with lossy nested inputs to
from_unixtimeretain required sorts and return correctly ordered rows.