looks like a bug in kylin. opened a jira in https://issues.apache.org/jira/browse/KYLIN-1689 since it's not typical for a numerical column to be dimension as well as sum metric, the bug fix may come late
On Mon, May 9, 2016 at 10:44 AM, 胡志华(万里通科技及数据中心商务智能团队数据分析组) < [email protected]> wrote: > Hi all, > > > > I recently built a cube named c1, use 2 columns as dimensions > ,”rule_name”,” PARTNER_GAIN_PAY_PT_DOC_CNT”, also use ” > sum(PARTNER_GAIN_PAY_PT_DOC_CNT)” as measure. C1 was built successfully. > > > > So, I made a query sql to test, that is “select > rule_name,PARTNER_GAIN_PAY_PT_DOC_CNT > ,count(*),sum(PARTNER_GAIN_PAY_PT_DOC_CNT) from > CUB_PARTNER_GAIN_PAY_PT_PRE0_AT0_S where rule_name='1号店3C产品' group by > rule_name,PARTNER_GAIN_PAY_PT_DOC_CNT;”, but the result is not probably > exactly. > > RULE_NAME PARTNER... EXPR$2 EXPR$3 > > 1号店3C产品 1860 30 1860 > > 1号店3C产品 700 2 700 > > 1号店3C产品 7410 38 7410 > > 1号店3C产品 2940 60 2940 > > > > In my opinion,”count(*)” means the amount of records with the same > rule_name and PARTNER_GAIN_PAY_PT_DOC_CNT, so I think sum(PARTNER…) equals > > Count(*) * PARTNER_GAIN_PAY_PT_DOC_CNT, but the truth is not , I wonder if > there is something wrong with my understanding? > > > > Insight snapshot as below: > > > > > > > > > > > > ******************************************************************************************************************************** > The information in this email is confidential and may be legally > privileged. If you have received this email in error or are not the > intended recipient, please immediately notify the sender and delete this > message from your computer. Any use, distribution, or copying of this email > other than by the intended recipient is strictly prohibited. All messages > sent to and from us may be monitored to ensure compliance with internal > policies and to protect our business. > Emails are not secure and cannot be guaranteed to be error free as they > can be intercepted, amended, lost or destroyed, or contain viruses. Anyone > who communicates with us by email is taken to accept these risks. > > 收发邮件者请注意: > 本邮件含保密信息,若误收本邮件,请务必通知发送人并直接删去,不得使用、传播或复制本邮件。 > 进出邮件均受到本公司合规监控。邮件可能发生被截留、被修改、丢失、被破坏或包含计算机病毒等不安全情况。 > > ******************************************************************************************************************************** > -- Regards, *Bin Mahone | 马洪宾* Apache Kylin: http://kylin.io Github: https://github.com/binmahone
