[
https://issues.apache.org/jira/browse/KYLIN-1377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15255767#comment-15255767
]
simplogic commented on KYLIN-1377:
----------------------------------
We meet the need to select top n domain/apps visited by most unique users. Will
CountDistinct be supported as another OrderBy expression in the nearly future?
> TopN measure should support more expressions
> --------------------------------------------
>
> Key: KYLIN-1377
> URL: https://issues.apache.org/jira/browse/KYLIN-1377
> Project: Kylin
> Issue Type: New Feature
> Affects Versions: v1.4.0
> Reporter: Shaofeng SHI
> Assignee: Shaofeng SHI
> Fix For: Backlog
>
>
> TopN should support not only SUM, but also MAX, MIN as the expression.
> A possible case is, find out the sellers which sold the top expensive items:
> select seller_id, max(price) from sals_records where region = 'US' and year =
> '2015' order by max(price) desc limit 100;
> In the future, more parameter should be supported
> 1) the expression (default SUM); 2) the soring order (default Desc). 3) the
> encoding method:
> A sample is:
> {code}
> {
> "name" : "TOP_SELLER",
> "function" : {
> "expression" : "TOP_N",
> "parameter" : {
> "id": 0,
> "type" : "column",
> "value" : "PRICE",
> "next_parameter" : {
> "id": 1,
> "type" : "column",
> "value" : "SELLER_ID",
> "next_parameter" : {
> "id": 2,
> "type" : "",
> "value" : "SUM",
> "next_parameter" : {
> "id": 3,
> "type" : "",
> "value" : "DESC"
> "next_parameter" : {
> "id": 4,
> "type" : "",
> "value" : "dict"
> }
> }
> }
> },
> "returntype" : "topn(100)"
> },
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)