Repository navigation
Fix Decimal to Interval conversion: catch error at type resolution time - #96111
Merged
Merged
Conversation
The `toInterval*` functions (e.g. `toIntervalMillisecond`) only checked for incompatible Decimal input types at execution time inside `ConvertImpl::execute`. When a table was empty, no blocks were processed, so the function was never called and the error was silently missed. Move the check to `getReturnTypeImplRemovedNullable` so it is caught during query analysis regardless of whether the table has data. Also fix the error message in `ConvertImpl::execute` which included a mangled C++ type name from `typeid(FromDataType).name()` producing unreadable output like `Decimal64/N2DB15DataTypeDecimalINS_7DecimalIlEEEE`. Closes #75451 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Contributor
|
Workflow [PR], commit [e7311fa] Summary: ❌
|
Algunenano
approved these changes
Feb 5, 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.
The
toInterval*functions (e.g.toIntervalMillisecond) only checked for incompatible Decimal input types at execution time insideConvertImpl::execute. When a table was empty, no blocks were processed, so the function was never called and the error was silently missed.Move the check to
getReturnTypeImplRemovedNullableso it is caught during query analysis regardless of whether the table has data.Also fix the error message in
ConvertImpl::executewhich included a mangled C++ type name fromtypeid(FromDataType).name()producing unreadable output likeDecimal64/N2DB15DataTypeDecimalINS_7DecimalIlEEEE.Closes #75451
Changelog category (leave one):
Note: Maybe we can implement conversion from Decimal to Interval later.
Version info
26.2.1.297