git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[jira] [Created] (CALCITE-2643) CAST operations on microsecond and nanosecond columns getting down cast to TIMSTAMP(3)


Wamsi Viswanath created CALCITE-2643:
----------------------------------------

             Summary: CAST operations on microsecond and nanosecond columns getting down cast to TIMSTAMP(3)
                 Key: CALCITE-2643
                 URL: https://issues.apache.org/jira/browse/CALCITE-2643
             Project: Calcite
          Issue Type: Bug
          Components: core
    Affects Versions: 1.16.0
            Reporter: Wamsi Viswanath
            Assignee: Julian Hyde


Hello,

Calcite is automatically generating TIMSTAMP(3) casts even though we explicitly mention  TIMSTAMP(6) or  TIMSTAMP(9). Please see the below query and generated calcite:

 
{code:java}
explain calcite select cast(m_9 as timestamp(6)) from test;
-------------------------------------------------------------
Explanation
LogicalProject(EXPR$0=[CAST($19):TIMESTAMP(3)])
 EnumerableTableScan(table=[[mapd, test]])

select cast(m_9 as timestamp(6)) from test limit 2;
-----------------------------------------------------
2006-04-26 03:49:04.607
2006-04-26 03:49:04.607

explain calcite select cast(m_6 as timestamp(9)) from test limit 2;
---------------------------------------------------------------------------
Explanation
LogicalSort(fetch=[2])
 LogicalProject(EXPR$0=[CAST($18):TIMESTAMP(3)])
 EnumerableTableScan(table=[[mapd, test]])

{code}
I found there was a related issue regarding this and was mentioned that it was fixed in `1.13.0`, we are using `1.16.0` and the problem still persists.

 



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