ok, my kylin version is kylin 2.0.0-hbase 0.98.8. here is the error log:
-----------------------------------------------------------------------------------------------------------------------
Caused by: java.lang.IndexOutOfBoundsException: Index: 2, Size: 2
at java.util.ArrayList.rangeCheck(ArrayList.java:635)
at java.util.ArrayList.get(ArrayList.java:411)
at
org.apache.kylin.query.relnode.ColumnRowType.getColumnByIndex(ColumnRowType.java:49)
at
org.apache.kylin.query.relnode.OLAPAggregateRel.fillbackOptimizedColumn(OLAPAggregateRel.java:396)
at
org.apache.kylin.query.relnode.OLAPAggregateRel.buildRewriteFieldsAndMetricsColumns(OLAPAggregateRel.java:347)
at
org.apache.kylin.query.relnode.OLAPAggregateRel.implementRewrite(OLAPAggregateRel.java:283)
at
org.apache.kylin.query.relnode.OLAPRel$RewriteImplementor.visitChild(OLAPRel.java:158)
at
org.apache.kylin.query.relnode.OLAPLimitRel.implementRewrite(OLAPLimitRel.java:107)
at
org.apache.kylin.query.relnode.OLAPRel$RewriteImplementor.visitChild(OLAPRel.java:158)
at
org.apache.kylin.query.relnode.OLAPToEnumerableConverter.implement(OLAPToEnumerableConverter.java:100)
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)
at
org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:776)
at
org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:632)
at
org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:602)
at
org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:214)
at
org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:595)
at
org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:615)
at
org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:148)
-----------------------------------------------------------------------------------------------------------------------
2017-12-08
skyyws
发件人:ShaoFeng Shi <[email protected]>
发送时间:2017-12-07 22:53
主题:Re: A problem about retention rate analyze
收件人:"user"<[email protected]>
抄送:
Hi Sky,
What's the error you got when querying just one intersect_count? Besides,
what's your Kylin version?
2017-12-07 16:22 GMT+08:00 skyyws <[email protected]>:
Hi guys,
I found that kylin supported retention rate analyze function, so I made some
test for this function. The following SQL executed successful:
-----------------------------------------------------------------------------------------------------------------------
select city, version,
intersect_count(uuid, dt, array['20161014']) as first_day,
intersect_count(uuid, dt, array['20161015']) as second_day,
intersect_count(uuid, dt, array['20161016']) as third_day,
intersect_count(uuid, dt, array['20161014', '20161015']) as retention_oneday,
intersect_count(uuid, dt, array['20161014', '20161015', '20161016']) as
retention_twoday
from visit_log
where dt in ('2016104', '20161015', '20161016')
group by city, version
-----------------------------------------------------------------------------------------------------------------------
but, other SQLs executed failed like this:
-----------------------------------------------------------------------------------------------------------------------
select city, version, intersect_count(uuid, dt, array['20161014', '20161015'])
as retention_oneday
from visit_log where dt in ('2016104', '20161015',) group by city, version
-----------------------------------------------------------------------------------------------------------------------
select city, version,intersect_count(uuid, dt, array['20161014', '20161015',
'20161016']) as retention_twoday
from visit_log where dt in ('2016104', '20161015', '20161016') group by city,
version
-----------------------------------------------------------------------------------------------------------------------
which means I cannot use just one intersect_count UDAF in a SQL, at lease two
intersect_count, is this a bug or designed to do so?
2017-12-07
skyyws
--
Best regards,
Shaofeng Shi 史少锋