You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2023/04/28 06:25:00 UTC
[jira] [Resolved] (CALCITE-4698) Respect input types and precision for datetime '+' operator and TIMESTAMPADD function
[ https://issues.apache.org/jira/browse/CALCITE-4698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Julian Hyde resolved CALCITE-4698.
----------------------------------
Fix Version/s: 1.35.0
Resolution: Fixed
Fixed in [07a29b60|https://github.com/apache/calcite/commit/07a29b607199dfb9af46380faecd7747f8526272]; thanks, [~Sergey Nuyanzin]!
> Respect input types and precision for datetime '+' operator and TIMESTAMPADD function
> -------------------------------------------------------------------------------------
>
> 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
> Fix For: 1.35.0
>
> Time Spent: 1h 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.
> Same issue is for precision datetime_plus.
> Also precision is lost.
> A number of queries highlighting the issue
> {code:sql}
> SELECT timestamp '2003-08-02 12:54:01' - INTERVAL '1.123' SECOND(1, 3);
> SELECT time '12:12:12' + INTERVAL '3.456' SECOND(1, 3);
> SELECT timestampadd(SQL_TSI_FRAC_SECOND, 2, timestamp with local time zone '2016-02-24 12:42:25.000');
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)