You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Wamsi Viswanath (JIRA)" <ji...@apache.org> on 2018/11/06 18:05:00 UTC

[jira] [Comment Edited] (CALCITE-2656) Timestamp Micro and Nano Strings literals are getting rounded to milliseconds

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

Wamsi Viswanath edited comment on CALCITE-2656 at 11/6/18 6:04 PM:
-------------------------------------------------------------------

It does not truncate sub seconds when we put it in where clause: 
{code:java}
explain calcite select count(*) from test where m_6 = TIMESTAMP(6) '1999-07-11 14:02:53.874533';
Explanation
LogicalAggregate(group=[{}], EXPR$0=[COUNT()])
 LogicalProject($f0=[0])
 LogicalFilter(condition=[=($18, CAST('1999-07-11 14:02:53.874533'):TIMESTAMP(6) NOT NULL)])
 EnumerableTableScan(table=[[mapd, test]])
{code}


was (Author: wamsiv):
The same thing works when we put it in where clause: 
{code:java}
explain calcite select count(*) from test where m_6 = TIMESTAMP(6) '1999-07-11 14:02:53.874533';
Explanation
LogicalAggregate(group=[{}], EXPR$0=[COUNT()])
 LogicalProject($f0=[0])
 LogicalFilter(condition=[=($18, CAST('1999-07-11 14:02:53.874533'):TIMESTAMP(6) NOT NULL)])
 EnumerableTableScan(table=[[mapd, test]])
{code}

> Timestamp Micro and Nano Strings literals are getting rounded to milliseconds 
> ------------------------------------------------------------------------------
>
>                 Key: CALCITE-2656
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2656
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.16.0
>            Reporter: Wamsi Viswanath
>            Assignee: Julian Hyde
>            Priority: Major
>
> explain calcite select m_6 = cast( '1999-07-11 14:02:53.874533' as TIMESTAMP(6)) from test;
> Explanation
> LogicalProject(EXPR$0=[=($18, 1999-07-11 14:02:53.875)])
>  EnumerableTableScan(table=[[mapd, test]])
>  
> Please let me know if this is an expected behavior ? Thank you!



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)