You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Pavel Pereslegin (Jira)" <ji...@apache.org> on 2025/05/06 16:37:00 UTC
[jira] [Updated] (IGNITE-21557) Sql. Fix TIMESTAMP_WITH_LOCAL_TIME_ZONE interval arithmetic.
[ https://issues.apache.org/jira/browse/IGNITE-21557?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pavel Pereslegin updated IGNITE-21557:
--------------------------------------
Fix Version/s: 3.1
> Sql. Fix TIMESTAMP_WITH_LOCAL_TIME_ZONE interval arithmetic.
> ------------------------------------------------------------
>
> Key: IGNITE-21557
> URL: https://issues.apache.org/jira/browse/IGNITE-21557
> Project: Ignite
> Issue Type: Bug
> Components: sql
> Reporter: Pavel Pereslegin
> Priority: Major
> Labels: ignite-3
> Fix For: 3.1
>
>
> The following interval arithmetic works incorrectly
> {code:SQL}
> select TIMESTAMP WITH LOCAL TIME ZONE '2021-01-01 00:00:00' + INTERVAL 1 MONTH
> -- result 2021-01-01 00:00:00.001
> select TIMESTAMP WITH LOCAL TIME ZONE '2021-01-01 00:00:00' + INTERVAL 1 YEAR
> -- result 2021-01-01 00:00:00.012
> {code}
> Looks like the main issue is near StandardConvertletTable#convertPlus (selecting wrong execution branch)
> {code:java}
> switch (rex.getType().getSqlTypeName()) {
> case DATE:
> case TIME:
> case TIMESTAMP:
> // *_WITH_LOCAL_TIME_ZONE types missed
> {code}
> and probably in DatetimeArithmeticImplementor#implementSafe
> {code:java}
> default:
> final BuiltInMethod method =
> operand0.getType().getSqlTypeName() == SqlTypeName.TIMESTAMP
> ? BuiltInMethod.ADD_MONTHS
> : BuiltInMethod.ADD_MONTHS_INT;
> return Expressions.call(method.method, trop0, trop1);
> {code}
> https://issues.apache.org/jira/browse/CALCITE-6287
--
This message was sent by Atlassian Jira
(v8.20.10#820010)