kylin-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ShaoFeng Shi <shaofeng...@apache.org>
Subject Re: Question regarding topN measure on string column
Date Sun, 02 Apr 2017 14:33:17 GMT
Kylin TopN's "sum|order by" supports two options a) a numeric column, b)
constant 1.

The option b) can match your requirement in my understanding. You just need
define "product_name" as the "group by" column in TopN, and constant 1 as
the "sum|order by" column; dont' forget to use "city" as cube's dimension,
then you can fetch the top products with SQL like:

select city, product_name, sum(1) as occurancy from fact_table where city
in ("abc") group by city order by occurancy desc limit 100;

If the "product_name" is a UHC column, you'd better use a non-dict encoding
(like "fixed_length") method for it.



2017-04-01 9:07 GMT+08:00 Billy Liu <billyliu@apache.org>:

> group by SUM, or group by COUNT is reasonable and supported. There is no
> order by name alphabetical support.
>
> 2017-03-31 20:16 GMT+08:00 hongbin ma <mahongbin@apache.org>:
>
> > ​hi,
> >
> > i believe it's not supported. besides, how do you define "order" on
> string?
> > I don't think it's a reasonable requirement
> >
> > --
> > Regards,
> >
> > *Bin Mahone | 马洪宾*
> >
>



-- 
Best regards,

Shaofeng Shi 史少锋

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message