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

Iurii Gerzhedovich commented on IGNITE-19162:
---------------------------------------------

It can't be fixed on the Ignite side, it should be fixed in Calcite

> Sql. Trim all less than millisecond information from timestamp.
> ---------------------------------------------------------------
>
>                 Key: IGNITE-19162
>                 URL: https://issues.apache.org/jira/browse/IGNITE-19162
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 3.0.0-beta1
>            Reporter: Evgeny Stanilovsky
>            Assignee: Maksim Zhuravkov
>            Priority: Major
>              Labels: calcite2-required, calcite3-required, ignite-3
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Trim useful timestamp part:
> {noformat}
> CREATE TABLE timestamps(id INTEGER PRIMARY KEY, i TIMESTAMP(9));
> INSERT INTO timestamps VALUES (101, TIMESTAMP '2023-03-29 08:22:33.005007');
> SELECT i from timestamps; <--- expect inserted, obtain trimmed : 2023-03-29 
> 08:22:33.005 
> {noformat}
> The root cause :
> RelJson#toJson() -> getValue3 -> getValue2 ->
> RexLiteral#getValueAs -> 
> case TIMESTAMP:
>       if (clazz == Long.class) {
>         
>         return clazz.cast(((TimestampString) value).getMillisSinceEpoch()); 
> <-- here info is loosed.
>       }
> Also CURRENT_TIMESTAMP return only 3 digits after last dot, don`t take into 
> account *TIMESTAMP(precision)*
> The same for default value :
> testInsertDefaultValue ->
> DdlSqlToCommandConverter#fromLiteral
> case TIMESTAMP:



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

Reply via email to