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

Julian Hyde commented on CALCITE-4698:
--------------------------------------

Note that this change does not affect the {{TIMESTAMP_ADD}} function (enabled 
for BigQuery) but does affect {{{}SqlStdOperatorTable.DATETIME_PLUS{}}}, e.g. 
{{{}TIMESTAMP '1969-07-21 00:00:00.000' + INTERVAL '3' MILLISECOND{}}}., 
because that operator also uses \{{class SqlDatetimePlusOperator}}. Should it 
also affect datetime minus?

[~Sergey Nuyanzin], I reviewed your PR
 * The change is now not just about data type but also about precision; can you 
update this case's summary and description
 * The logic in {{deduceType}} is still convoluted. I have never understood why 
MILLISECOND and MICROSECOND have to be treated separately.
 * Can you add tests for {{{}SqlStdOperatorTable.DATETIME_PLUS{}}}, e.g. 
TIMESTAMP '...' + INTERVAL '...'. (I could not find any in 
{{{}SqlOperatorTest{}}}.)
 * Should this change also apply to the datetime '-' operator, e.g. TIMESTAMP' 
...' - INTERVAL '...'. (See {{{}SqlOperatorTest.testMinusIntervalOperator{}}}.)

> Return type of timestampadd(..., ..., timestamp_ltz) should be timestamp_ltz 
> instead of timestamp
> -------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-4698
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4698
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Caizhi Weng
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> Currently {{SqlTimestampAddFunction#deduceType}} does not deal with 
> timestamp_ltz type correctly. Return type of {{timestampadd(..., ..., 
> timestamp_ltz)}} will be timestamp but it should be timestamp_ltz.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to