Fix a small bug on DT64->T->T64 conversion#90324
Merged
Conversation
Contributor
|
Workflow [PR], commit [fecfcbe] Summary: ❌
|
Member
Author
|
Provided test requires #90310 |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug in the conversion chain from DateTime64 to Time to Time64, where intermediate Time values (represented as seconds) were incorrectly treated as day numbers during the final conversion to Time64.
Key Changes:
- Fixed
ToTime64Transform::execute(Int32 d, ...)to correctly preserve Time values (seconds) instead of misinterpreting them as day numbers - Added test cases to verify the fix for the specific conversion path: DateTime64 -> Time -> Time64
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Functions/FunctionsConversion.h | Fixed ToTime64Transform::execute(Int32, ...) to directly use seconds value instead of incorrectly converting through fromDayNum |
| tests/queries/0_stateless/03365_time_to_time64_conv_bug.sql | Added test queries for DateTime64->Time->Time64 conversion chain |
| tests/queries/0_stateless/03365_time_to_time64_conv_bug.reference | Expected results showing correct time preservation through conversion chain |
…64-conversion-bug
yakov-olkhovskiy
approved these changes
Nov 20, 2025
…64-conversion-bug
Member
Author
|
Stateless tests (amd_binary, ParallelReplicas, s3 storage, parallel) -- flaky Integration tests (amd_tsan, 3/6) -- flaky AST Fuzzer and BuzzHouse are not related. |
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.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixes a bug where
SELECT CAST(CAST(now(), 'Time'), 'Time64')was producing incorrect result. Closes #88349Documentation entry for user-facing changes