[ 
https://issues.apache.org/jira/browse/CALCITE-5478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17678464#comment-17678464
 ] 

Julian Hyde commented on CALCITE-5478:
--------------------------------------

Seems basically right. But I worry that we can't apply the same logic to 
TIMESTAMP as to, say, DECIMAL.

{{TIMESTAMP(5)}} means something like 19 'digits' of precision (14 'digits' to 
the left of the point, e.g. 9999-12-31 23:59:59, and 5 digits to the right).

{{DECIMAL(8, 3)}} means 8 digits of precision (8 total, 3 of which are right of 
the decimal).

The "5" in "TIMESTAMP(5)" is a bit more like scale than precision. So let's 
just check that logic.

> 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)

Reply via email to