Kylin do pre-aggregation of sums, thus the condition inside sum has to be pre-defined at cube build time.
A work around is to define "if(col>1024,col,0)" as a new column say "col_1024", then define "sum(col_1024)" as a cube measure. Hive view can be used to define extra columns easily. Kylin can use Hive view as fact table with no problem. On Tue, Mar 29, 2016 at 10:24 AM, [email protected] <[email protected] > wrote: > Hi, > Support for multiple conditions query kylin?Just like this: > All of the fields that have been set the dimension > eg1: > select > sum(a.Reqnum),sum(a.shownum),sum(a.clicknum),sum(a.RtbActBidReq),sum(a.RtbWinBidReq) > from > ( > select > case when RequestMode=1 and ProcessNode>=2 then 1 else 0 end as Reqnum, > case when RequestMode=2 and IsEffective='1' then 1 else 0 end as shownum, > case when RequestMode=3 and IsEffective='1' then 1 else 0 end as clicknum, > case when ADPlatformProviderID>=100000 and IsEffective='1' and > IsBilling='1' and IsBid=1 then 1 else 0 end as RtbActBidReq, > case when ADPlatformProviderID>=100000 and IsEffective='1' and > IsBilling='1' and IsWin=1 then 1 else 0 end as RtbWinBidReq > from parquetlog > ) a > > eg2: > select sum(if(RequestMode=1 and ProcessNode>=1,1,0)) from parquetlog > > Thinks!! >
