[
https://issues.apache.org/jira/browse/CALCITE-5478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17690553#comment-17690553
]
Gian Merlino commented on CALCITE-5478:
---------------------------------------
Thanks for your comment. Sorry for the delay in responding. I was out of office
for a bit, but I am back at work now.
The PR I linked implements simpler logic for datetimes, rather than treating
datetimes and decimals the same way. I added a couple of tests for it. I
believe the logic is correct: if both types under consideration are datetimes,
and have same type name, then take the max precision across the two types.
> Use highest input precision for datetimes in
> SqlTypeFactoryImpl.leastRestrictive
> --------------------------------------------------------------------------------
>
> Key: CALCITE-5478
> URL: https://issues.apache.org/jira/browse/CALCITE-5478
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: Gian Merlino
> Priority: Major
> Labels: pull-request-available
> Time Spent: 20m
> Remaining Estimate: 0h
>
> For example: {{leastRestrictive(TIMESTAMP(3), TIMESTAMP(0))}} would be
> {{TIMESTAMP(3)}}, not {{TIMESTAMP(0)}}.
> Some code exists to do this for other types, but not datetimes.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)