Fw: Kylin Hybrids Cont distinct got wrong value

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Fw: Kylin Hybrids Cont distinct got wrong value

lk_hadoop


2019-11-11

lk_hadoop



发件人:"lk_hadoop"<[hidden email]>
发送时间:2019-11-08 10:34
主题:Kylin Hybrids Cont distinct got wrong value
收件人:"user"<[hidden email]>
抄送:

hi , all :
    I have a Measure with Cont distinct algorithm , when I use a Hybrid ,The Hybrid include two cube, each cube have one years data , I can't get the meaningful result when across two year.

   -- get each year Cont distinct Measure value
SELECT ENT_NAME, ORD_YEAR ,SUM(PAID_IN_AMT) AS sum_PAID_IN_AMT, COUNT(DISTINCT TGOODS_ID) AS count_d_TGOODS_ID
FROM gjst.SH_FETCH_SALE_BASE_FACT_ALL_NEW2
WHERE ENT_NAME IN ('仁泰')
AND ORD_YEAR IN ('2018','2019')
GROUP BY ENT_NAME, ORD_YEAR
   
     ENT_NAME  |  ORD_YEAR  |   SUM_PAID_IN_AMT   |COUNT_D_TGOODS_ID
        仁泰                   2019                   186483922.94                7087
        仁泰                   2018                   236461205.81                9418

    -- get two year aggregation value
        SELECT ENT_NAME ,SUM(PAID_IN_AMT) AS sum_PAID_IN_AMT, COUNT(DISTINCT TGOODS_ID) AS count_d_TGOODS_ID
        FROM gjst.SH_FETCH_SALE_BASE_FACT_ALL_NEW2
        WHERE ENT_NAME IN ('仁泰')
        AND ORD_YEAR IN ('2018','2019')
        GROUP BY ENT_NAME

    ENT_NAME  |    SUM_PAID_IN_AMT   |COUNT_D_TGOODS_ID
        仁泰                   422945128.75                      9418

Is there any way to resolve it ?

2019-11-08


lk_hadoop
Reply | Threaded
Open this post in threaded view
|

Re:Fw: Kylin Hybrids Cont distinct got wrong value

nichunen-2
Hello,


Count distinct is not supported in Hybrid.


*Please note, Hybrid model is not suitable for “bitmap” count distinct measures’s merge across cubes, please have the partition date as a group by field in the SQL query. *
http://kylin.apache.org/docs/tutorial/hybrid.html



Best regards,

 

Ni Chunen / George



On 11/11/2019 17:27,lk_hadoop<[hidden email]> wrote:


2019-11-11

lk_hadoop



发件人:"lk_hadoop"<[hidden email]>
发送时间:2019-11-08 10:34
主题:Kylin Hybrids Cont distinct got wrong value
收件人:"user"<[hidden email]>
抄送:

hi , all :
I have a Measure with Cont distinct algorithm , when I use a Hybrid ,The Hybrid include two cube, each cube have one years data , I can't get the meaningful result when across two year.

-- get each year Cont distinct Measure value
SELECT ENT_NAME, ORD_YEAR ,SUM(PAID_IN_AMT) AS sum_PAID_IN_AMT, COUNT(DISTINCT TGOODS_ID) AS count_d_TGOODS_ID
FROM gjst.SH_FETCH_SALE_BASE_FACT_ALL_NEW2
WHERE ENT_NAME IN ('仁泰')
AND ORD_YEAR IN ('2018','2019')
GROUP BY ENT_NAME, ORD_YEAR

ENT_NAME  |  ORD_YEAR  |   SUM_PAID_IN_AMT   |COUNT_D_TGOODS_ID
仁泰                   2019                   186483922.94                7087
仁泰                   2018                   236461205.81                9418

-- get two year aggregation value
SELECT ENT_NAME ,SUM(PAID_IN_AMT) AS sum_PAID_IN_AMT, COUNT(DISTINCT TGOODS_ID) AS count_d_TGOODS_ID
FROM gjst.SH_FETCH_SALE_BASE_FACT_ALL_NEW2
WHERE ENT_NAME IN ('仁泰')
AND ORD_YEAR IN ('2018','2019')
GROUP BY ENT_NAME

ENT_NAME  |    SUM_PAID_IN_AMT   |COUNT_D_TGOODS_ID
仁泰                   422945128.75                      9418

Is there any way to resolve it ?

2019-11-08


lk_hadoop