The suggested way is to define new column for the if statement, for
example, in a Hive view.

2017-09-01 23:08 GMT+08:00 Yuxiang Mai <[email protected]>:

> Hi, experts
>
> We are using KYLIN for a Hive table with 3 columns with binary values: 1
> for true, 0 for false. For example: is_new, is_recommend, is_discount.
> We wonder if KYLIN the select if .. from ... like the following:
>
> hive> select shop, count(distinct if(is_new =1, item_id, NULL)) from table
> where dt='xxx' group by shop;
>
> or are we mandatory to use where condition is_new=1 ?
>
>
> Thanks for your reply.
>
>
> --
> Yuxiang Mai
>
>

Reply via email to