[ https://issues.apache.org/jira/browse/KYLIN-4682?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17171306#comment-17171306 ]
Zhong Yanghong commented on KYLIN-4682: --------------------------------------- For this kind of sql, we can extract filters on group by related columns and then push down these filters like {code} select LSTG_FORMAT_NAME, LEAF_CATEG_ID, sum(price) as gmv from TEST_KYLIN_FACT where LSTG_FORMAT_NAME = 'Auction' group by LSTG_FORMAT_NAME, LEAF_CATEG_ID {code} > java.lang.IndexOutOfBoundsException due to not setting havingFilter correctly > ----------------------------------------------------------------------------- > > Key: KYLIN-4682 > URL: https://issues.apache.org/jira/browse/KYLIN-4682 > Project: Kylin > Issue Type: Improvement > Reporter: Zhong Yanghong > Assignee: Zhong Yanghong > Priority: Major > > SQL: > {code} > select LSTG_FORMAT_NAME, LEAF_CATEG_ID, sum(price) as gmv > from TEST_KYLIN_FACT > group by LSTG_FORMAT_NAME, LEAF_CATEG_ID > having LSTG_FORMAT_NAME = 'Auction' > {code} > Error stack trace: > {code} > Caused by: java.lang.IndexOutOfBoundsException: Index: 3, Size: 1 > at java.util.ArrayList.rangeCheck(ArrayList.java:657) > at java.util.ArrayList.get(ArrayList.java:433) > at > org.apache.kylin.storage.gtrecord.GTCubeStorageQueryBase.checkHavingCanPushDown(GTCubeStorageQueryBase.java:553) > at > org.apache.kylin.storage.gtrecord.GTCubeStorageQueryBase.getStorageQueryRequest(GTCubeStorageQueryBase.java:196) > at > org.apache.kylin.storage.gtrecord.GTCubeStorageQueryBase.searchInner(GTCubeStorageQueryBase.java:98) > at > org.apache.kylin.storage.gtrecord.GTCubeStorageQueryBase.search(GTCubeStorageQueryBase.java:90) > at > org.apache.kylin.storage.hybrid.HybridStorageQuery.search(HybridStorageQuery.java:53) > at > org.apache.kylin.query.enumerator.OLAPEnumerator.queryStorage(OLAPEnumerator.java:117) > at > org.apache.kylin.query.enumerator.OLAPEnumerator.moveNext(OLAPEnumerator.java:60) > at Baz$1$1.moveNext(Unknown Source) > at > org.apache.calcite.linq4j.EnumerableDefaults.groupBy_(EnumerableDefaults.java:825) > at > org.apache.calcite.linq4j.EnumerableDefaults.groupBy(EnumerableDefaults.java:761) > at > org.apache.calcite.linq4j.DefaultEnumerable.groupBy(DefaultEnumerable.java:302) > at Baz.bind(Unknown Source) > at > org.apache.calcite.jdbc.CalcitePrepare$CalciteSignature.enumerable(CalcitePrepare.java:365) > at > org.apache.calcite.jdbc.CalciteConnectionImpl.enumerable(CalciteConnectionImpl.java:301) > at > org.apache.calcite.jdbc.CalciteMetaImpl._createIterable(CalciteMetaImpl.java:559) > at > org.apache.calcite.jdbc.CalciteMetaImpl.createIterable(CalciteMetaImpl.java:550) > at > org.apache.calcite.avatica.AvaticaResultSet.execute(AvaticaResultSet.java:182) > at > org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:67) > at > org.apache.calcite.jdbc.CalciteResultSet.execute(CalciteResultSet.java:44) > at > org.apache.calcite.avatica.AvaticaConnection$1.execute(AvaticaConnection.java:667) > at > org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:619) > at > org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:675) > at > org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:156) > ... 81 more > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)