kylin-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Li Yang <liy...@apache.org>
Subject Re: 答复: TOPN value, which sum measure column group by dimension, error.
Date Fri, 26 May 2017 08:52:11 GMT
Mind to create a JIRA?

On Mon, May 15, 2017 at 3:02 PM, 苏 志锋 <rocsky@live.com> wrote:

> I change the measure column "V" data type from integer to double. resubmit
> the sqls.
> SQL:   SELECT LV1,SUM(V) V FROM TEST GROUP BY LV1
> Return:             LV1       V
>                          001      -0.994
>
> whithe sum(v) value should be -1.0, but kylin return -0.994.
> dd
> SQL:  SELECT LV1,SUM(V) V,COUNT(*) C FROM TEST GROUP BY LV1
> Return:              LV1       V        C
>                           001       -1.0     1
> the sum(v) is right.
> ------------------------------
> *发件人:* 苏 志锋 <rocsky@live.com>
> *发送时间:* 2017年5月15日 12:06:41
> *收件人:* user@kylin.apache.org
> *主题:* TOPN value, which sum measure column group by dimension, error.
>
>
> TOPN value, which sum measure column group by dimension, error.
>
> *Environment*
>
>          Apache Kylin:1.6.0
>
> *STEPS*
>
>    1. Kafka produce one message
>    2. kylin consume the message
>    3. kylin build cuboid
>    4. execute sql
>
> *KafKa JSON data*
>
>          {“T”:”2017-05-15”,“LV1”:”001”,”V”:-1}
>
> *MODEL*
>
>          1、Dimensions : T, LV1
>
>          2、Measures : V
>
> *CUBE*
>
>    1. Dimensions : T, LV1
>    2. Measures: _COUNT_; SUM(V); TOPN SUM COLUMN V GROUP BY LV1;
>
> *SQL and result*
>
> 1、  SELECT LV1,SUM(V) V FROM TEST GROUP BY LV1
>
> LV1
>
> V
>
> 001
>
> 0
>
>
>
> 2、  SELECT LV1,SUM(V) V,COUNT(*) C FROM TEST GROUP BY LV1
>
> LV1
>
> V
>
> C
>
> 001
>
> -1
>
> 1
>
> *Problem*
>
>         The sum(v) value is error in sql 1, and correct in sql 2.
>
> The probably reasons are:
>
> 1、org.apache.kylin.measure.topn. TopNCounterSerializer.deserialize
> function deserialize -1 to -0.99.
>
> 2、org.apache.kylin.metadata.tuple.setMeasureValue function convert
> double(-0.99) to long(0)
>
>

Mime
View raw message