Shaofeng SHI created KYLIN-1831:
-----------------------------------
Summary: Couldn't run "count (distinct pk)" on a lookup table
Key: KYLIN-1831
URL: https://issues.apache.org/jira/browse/KYLIN-1831
Project: Kylin
Issue Type: Bug
Components: Query Engine
Affects Versions: v1.5.2
Reporter: Shaofeng SHI
Assignee: Dong Li
I have a SSB testing cube, in which ssb.customer is a lookup table, the cube
has been built successfully (table snapshot exists); As KYLIN-1016 mentioned,
count distinct should work even if there is no pre-defined measure; The SQL is:
"select count (distinct c_custkey) from ssb.customer", the error log is:
{code}
Caused by: java.lang.IllegalStateException: Can't create EnumerableAggregate!
at
org.apache.kylin.query.relnode.OLAPAggregateRel.implementEnumerable(OLAPAggregateRel.java:373)
at
org.apache.kylin.query.relnode.OLAPRel$JavaImplementor.createEnumerable(OLAPRel.java:158)
at
org.apache.kylin.query.relnode.OLAPRel$JavaImplementor.createEnumerable(OLAPRel.java:154)
at
org.apache.kylin.query.relnode.OLAPToEnumerableConverter.implement(OLAPToEnumerableConverter.java:99)
at
org.apache.calcite.adapter.enumerable.EnumerableRelImplementor.implementRoot(EnumerableRelImplementor.java:102)
at
org.apache.calcite.adapter.enumerable.EnumerableInterpretable.toBindable(EnumerableInterpretable.java:92)
at
org.apache.calcite.prepare.CalcitePrepareImpl$CalcitePreparingStmt.implement(CalcitePrepareImpl.java:1171)
at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:297)
at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:196)
at
org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:721)
at
org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:588)
at
org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:558)
at
org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:214)
at
org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:573)
at
org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:571)
at
org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:135)
... 80 more
Caused by: org.apache.calcite.rel.InvalidRelException: distinct aggregation not
supported
at
org.apache.calcite.adapter.enumerable.EnumerableAggregate.<init>(EnumerableAggregate.java:71)
at
org.apache.kylin.query.relnode.OLAPAggregateRel.implementEnumerable(OLAPAggregateRel.java:370)
... 95 more
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)