[
https://issues.apache.org/jira/browse/KYLIN-3322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16776087#comment-16776087
]
Shaofeng SHI commented on KYLIN-3322:
-------------------------------------
Hi Kang-sen, thanks for your feedback!
"In side the TOPN-cube, the correct answer would be go after the SUM(X) metric
directly. But my experiment seems to suggest the kylin took the path of going
after TOPN(SUM(X)), then sum over the dimension B, which in general has a hugh
cardinality, and therefore, takes a long tim eto finish." If this is true, then
it is a bug, we should fix it.
The reason of TopN need a separate SUM measure is, user's query may not have
the high-cardinality column (which is the B in your sample), in this case, if
we use TopN to answer, the result will be wrong (because only has limited B
values), and its performance is bad. While if we add a SUM, there is no such
issue: when user's query has B, we use TopN to anwer; if not, using the
accurate SUM measure to answer. Besides, a SUM measure's size is much less than
a TopN, it almost won't add overhead.
Let's work together to make Kylin better !
> TopN requires a SUM to work
> ---------------------------
>
> Key: KYLIN-3322
> URL: https://issues.apache.org/jira/browse/KYLIN-3322
> Project: Kylin
> Issue Type: Bug
> Components: Measure - TopN
> Reporter: liyang
> Assignee: Na Zhai
> Priority: Major
>
> Currently if user creates a measure of TopN seller by sum of price, it is
> required that user also creates a measure of SUM(price). Otherwise, NPE will
> be thrown at query time.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)