kylin-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 林豪(linhao)-技术产品中心 <lin...@qiyi.com>
Subject 答复: KYLIN throws null exception when execute specific query
Date Mon, 28 Nov 2016 06:01:02 GMT
So this is a bug of KYLIN? Is there any workaround like rewritten sql for such query??


________________________________
发件人: Alberto Ramón <a.ramonportoles@gmail.com>
发送时间: 2016年11月26日 0:37
收件人: user
主题: Re: KYLIN throws null exception when execute specific query

Hello



I tested your querie on "apache-kylin-1.6.0-SNAPSHOT-bin" and also fails   :(

I tried with some changes
SELECT count (1)
FROM
(
SELECT  PART_DT as PART_DT1, COUNT(1) as vv1
FROM KYLIN_SALES
GROUP BY PART_DT
) AS t1
JOIN
(

SELECT  PART_DT as PART_DT2, COUNT(1) as vv2
FROM KYLIN_SALES
GROUP BY PART_DT
) AS t2
ON (t1.PART_DT1 = t2.PART_DT2)
GROUP BY t1.PART_DT1,t2.vv2,t1.vv1, t2.PART_DT2


and also fails
work fine if you remove group by and do select *







2016-11-25 7:21 GMT+01:00 林豪(linhao)-技术产品中心 <linhao@qiyi.com<mailto:linhao@qiyi.com>>:
Hello,

I try to do some analyze using KYLIN, but it throws null exception when executing query. The
query tries to calculate VV ratio of condition A and condition B. For simplicity, I rewrite
a minimum query on ‘learn_kylin’ project and remove the condition, so it can be reproduced
easily.

KYLIN Version: apache-kylin-1.5.3 for HBase 0.98

Query:
SELECT t1.PART_DT, SUM(t2.vv) / SUM(t1.vv) AS vv_rate
FROM
(
SELECT  PART_DT, COUNT(1) as vv
FROM KYLIN_SALES
GROUP BY PART_DT
) AS t1
JOIN
(
SELECT  PART_DT, COUNT(1) as vv
FROM KYLIN_SALES
GROUP BY PART_DT
) AS t2
ON (t1.PART_DT = t2.PART_DT)
GROUP BY t1.PART_DT

Error on web page:
Error while executing SQL “SELECT …” null

KYLIN Server LOG:
null
        at org.apache.calcite.avatica.Helper.createException(Helper.java:56)
        at org.apache.calcite.avatica.Helper.createException(Helper.java:41)
        at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:143)
        at org.apache.calcite.avatica.AvaticaStatement.executeQuery(AvaticaStatement.java:186)
        at org.apache.kylin.rest.service.QueryService.execute(QueryService.java:366)
        at org.apache.kylin.rest.service.QueryService.queryWithSqlMassage(QueryService.java:278)
        at org.apache.kylin.rest.service.QueryService.query(QueryService.java:121)
        at org.apache.kylin.rest.service.QueryService$$FastClassByCGLIB$$4957273f.invoke(<generated>)
…..
Caused by: java.lang.NullPointerException
        at org.apache.kylin.query.relnode.OLAPAggregateRel.translateAggregation(OLAPAggregateRel.java:268)
        at org.apache.kylin.query.relnode.OLAPAggregateRel.implementRewrite(OLAPAggregateRel.java:240)
        at org.apache.kylin.query.relnode.OLAPRel$RewriteImplementor.visitChild(OLAPRel.java:121)
        at org.apache.kylin.query.relnode.OLAPProjectRel.implementRewrite(OLAPProjectRel.java:233)
        at org.apache.kylin.query.relnode.OLAPRel$RewriteImplementor.visitChild(OLAPRel.java:121)
        at org.apache.kylin.query.relnode.OLAPLimitRel.implementRewrite(OLAPLimitRel.java:101)
        at org.apache.kylin.query.relnode.OLAPRel$RewriteImplementor.visitChild(OLAPRel.java:121)
        at org.apache.kylin.query.relnode.OLAPToEnumerableConverter.implement(OLAPToEnumerableConverter.java:95)
        at org.apache.calcite.adapter.enumerable.EnumerableRelImplementor.implementRoot(EnumerableRelImplementor.java:102)

Mime
View raw message