Dong Li created KYLIN-2538:
------------------------------

             Summary: 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


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
(v6.3.15#6346)

Reply via email to