refactor(isthmus): drop the unused TIME_WITH_LOCAL_TIME_ZONE precision override - #1150
Open
alexandrefimov wants to merge 1 commit into
Open
refactor(isthmus): drop the unused TIME_WITH_LOCAL_TIME_ZONE precision override#1150alexandrefimov wants to merge 1 commit into
alexandrefimov wants to merge 1 commit into
Conversation
…n override getMaxPrecision raised the maximum precision to 6 for TIME_WITH_LOCAL_TIME_ZONE alongside the types Isthmus actually converts. Substrait has precision_timestamp_tz but no time-with-timezone counterpart, so the type appears in neither direction of TypeConverter, and the case was the only mention of the name in the repository. It has been there since the initial commit rather than added to keep a validation path working. Removing it changes nothing observable. Calcite's type factory clamps a precision above the maximum instead of rejecting it, so the entry was not letting a bad precision get further than it otherwise would: with it CAST(NULL AS TIME(4) WITH LOCAL TIME ZONE) reaches the converter as TIME_WITH_LOCAL_TIME_ZONE(4), without it as TIME_WITH_LOCAL_TIME_ZONE(3), and both fail with the same UnsupportedOperationException. Precisions 0 through 6 failed at conversion before and still do. The test pins the premise as well as the entry: if the type ever does convert, the assertion that toSubstrait rejects it fails and points at the maximum that would then need setting.
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.
getMaxPrecisionraised the maximum precision to 6 forTIME_WITH_LOCAL_TIME_ZONEalongside the types Isthmus actually converts. Substrait hasprecision_timestamp_tzbut no time-with-timezone counterpart, so the type appears in neither direction ofTypeConverter, and thecasewas the only mention of the name in the repository. It has been there since the initial commit rather than added to keep a validation path working.Removing it changes nothing observable. Calcite's type factory clamps a precision above the maximum instead of rejecting it, so the entry was not letting a bad precision get further than it otherwise would: with it
CAST(NULL AS TIME(4) WITH LOCAL TIME ZONE)reaches the converter asTIME_WITH_LOCAL_TIME_ZONE(4), without it asTIME_WITH_LOCAL_TIME_ZONE(3), and both fail with the sameUnsupportedOperationException. Precisions 0 through 6 failed at conversion before and still do.The test pins the premise as well as the entry: if the type ever does convert, the assertion that
toSubstraitrejects it fails and points at the maximum that would then need setting.Closes #1149.