Create a JIRA: https://issues.apache.org/jira/browse/KYLIN-2234

 

林豪

技术产品中心 云平台 | 服务云Wiki 云路系统

( |分机 8393| +86 13611801618 | * linhao@qiyi.com

 

From: ShaoFeng Shi <shaofengshi@apache.org>
Reply-To: "user@kylin.apache.org" <user@kylin.apache.org>
Date: Monday, 28 November 2016 at 4:08 PM
To: user <user@kylin.apache.org>
Subject: Re: KYLIN throws null exception when execute specific query

 

Hi Linhao,

 

Wecome to open a JIRA to Kylin: https://issues.apache.org/jira/secure/Dashboard.jspa

 

2016-11-28 14:42 GMT+08:00 林豪(linhao-术产品中心 <linhao@qiyi.com>:

So, this is a bug of KYLIN? Is there any workaround solution?

 

林豪

技术产品中心 云平台 | 服务云Wiki 云路系统

( |分机 8393| +86 13611801618 | * linhao@qiyi.com

 

From: Alberto Ramón <a.ramonportoles@gmail.com>
Reply-To: "user@kylin.apache.org" <user@kylin.apache.org>
Date: Saturday, 26 November 2016 at 12:37 AM
To: user <user@kylin.apache.org>
Subject: 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>:

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)

 



 

--

Best regards,

 

Shaofeng Shi 史少