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

nichunen closed KYLIN-2538.
---------------------------
    Resolution: Fixed

Tested, fixed on 3.0-beta

> extract(MONTH from CURRENT_DATE) cannot be selected as a column in sql
> ----------------------------------------------------------------------
>
>                 Key: KYLIN-2538
>                 URL: https://issues.apache.org/jira/browse/KYLIN-2538
>             Project: Kylin
>          Issue Type: Bug
>          Components: Query Engine
>            Reporter: Dong Li
>            Assignee: liyang
>            Priority: Major
>
> From calcite SQL reference: CURRENT_DATE is a const to get the value of 
> current value.
> But in Kylin this SQL will fail with exceptions:
> select extract(MONTH from CURRENT_DATE), count(*) from test_kylin_fact
> Error message:
> Error while executing SQL "select extract(MONTH from CURRENT_DATE), count(*) 
> from test_kylin_fact LIMIT 50000": No TblColRef found in 
> EXTRACT_DATE(FLAG(MONTH), Reinterpret(CURRENT_DATE))
> Stacktrace:
> Caused by: java.lang.IllegalStateException: No TblColRef found in 
> EXTRACT_DATE(FLAG(MONTH), Reinterpret(CURRENT_DATE))
>         at 
> org.apache.kylin.query.relnode.OLAPProjectRel.buildColumnRowType(OLAPProjectRel.java:132)
>         at 
> org.apache.kylin.query.relnode.OLAPProjectRel.implementOLAP(OLAPProjectRel.java:117)
>         at 
> org.apache.kylin.query.relnode.OLAPRel$OLAPImplementor.visitChild(OLAPRel.java:83)
>         at 
> org.apache.kylin.query.relnode.OLAPLimitRel.implementOLAP(OLAPLimitRel.java:75)
>         at 
> org.apache.kylin.query.relnode.OLAPRel$OLAPImplementor.visitChild(OLAPRel.java:83)
>         at 
> org.apache.kylin.query.relnode.OLAPToEnumerableConverter.implement(OLAPToEnumerableConverter.java:85)
>         at 
> org.apache.calcite.adapter.enumerable.EnumerableRelImplementor.implementRoot(EnumerableRelImplementor.java:108)
>         at 
> org.apache.calcite.adapter.enumerable.EnumerableInterpretable.toBindable(EnumerableInterpretable.java:92)
>         at 
> org.apache.calcite.prepare.CalcitePrepareImpl$CalcitePreparingStmt.implement(CalcitePrepareImpl.java:1248)
>         at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:306)
>         at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:203)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to