You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Konstantin Orlov (Jira)" <ji...@apache.org> on 2022/09/17 08:57:00 UTC

[jira] [Updated] (IGNITE-17376) Sql. Investigate of support default value for TIMESTAMP WITH LOCAL TIME ZONE type

     [ https://issues.apache.org/jira/browse/IGNITE-17376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Konstantin Orlov updated IGNITE-17376:
--------------------------------------
    Description: 
Currently default value is not supported for columns with type {{TIMESTAMP WITH LOCAL TIME ZONE}}, because behaviour is not clear:
* if default value literal MUST contain time zone, then sql parser should be extended to provide ability to specify timestamp with time zone literal
* if default value literal MAY NOT contain time zone, then some research is needed. Consider the following case:

{code:java}
CREATE TABLE t (id INT PRIMARY KEY, val TIMESTAMP WITH LOCAL TIME ZONE DEFAULT TIMESTAMP '2021-01-01 01:01:01')
{code}

Which timezone should be chosen for converting this literal to UTC: timezone of the server or timezone of the client who create this table? Should the inserted values be the same in case the user inserts values explicitly or implicitly (though DEFAULT) like that:

{code:java}
INSERT INTO t (id) VALUES (0);
                       VS
INSERT INTO t (id, val) VALUES (0, DEFAULT);
                       VS
INSERT INTO t (id, val) VALUES (0, TIMESTAMP '2021-01-01 01:01:01');
{code}

Let's provide some research on this topic and chose the proper way to address the issue.



  was:
Currently default value is not supported for columns with type {{TIMESTAMP WITH LOCAL TIME ZONE}}, because behaviour is not clear:
* if default value literal MUST contain time zone, then sql parser should be extended to provide ability to specify timestamp with time zone literal
* if default value literal MIGHT NOT contain time zone, then some research is needed. Consider the following case:

{code:java}
CREATE TABLE t (id INT PRIMARY KEY, val TIMESTAMP WITH LOCAL TIME ZONE DEFAULT TIMESTAMP '2021-01-01 01:01:01')
{code}

Which timezone should be chosen for converting this literal to UTC: timezone of the server or timezone of the client who create this table? Should the inserted values be the same in case the user inserts values explicitly or implicitly (though DEFAULT) like that:

{code:java}
INSERT INTO t (id) VALUES (0);
                       VS
INSERT INTO t (id, val) VALUES (0, DEFAULT);
                       VS
INSERT INTO t (id, val) VALUES (0, TIMESTAMP '2021-01-01 01:01:01');
{code}

Let's provide some research on this topic and chose the proper way to address the issue.




> Sql. Investigate of support default value for TIMESTAMP WITH LOCAL TIME ZONE type 
> ----------------------------------------------------------------------------------
>
>                 Key: IGNITE-17376
>                 URL: https://issues.apache.org/jira/browse/IGNITE-17376
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>            Reporter: Konstantin Orlov
>            Priority: Major
>              Labels: ignite-3, tech-debt
>
> Currently default value is not supported for columns with type {{TIMESTAMP WITH LOCAL TIME ZONE}}, because behaviour is not clear:
> * if default value literal MUST contain time zone, then sql parser should be extended to provide ability to specify timestamp with time zone literal
> * if default value literal MAY NOT contain time zone, then some research is needed. Consider the following case:
> {code:java}
> CREATE TABLE t (id INT PRIMARY KEY, val TIMESTAMP WITH LOCAL TIME ZONE DEFAULT TIMESTAMP '2021-01-01 01:01:01')
> {code}
> Which timezone should be chosen for converting this literal to UTC: timezone of the server or timezone of the client who create this table? Should the inserted values be the same in case the user inserts values explicitly or implicitly (though DEFAULT) like that:
> {code:java}
> INSERT INTO t (id) VALUES (0);
>                        VS
> INSERT INTO t (id, val) VALUES (0, DEFAULT);
>                        VS
> INSERT INTO t (id, val) VALUES (0, TIMESTAMP '2021-01-01 01:01:01');
> {code}
> Let's provide some research on this topic and chose the proper way to address the issue.



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