Thanks..

We will try it.

BTW, any drawbacks if we directly use in a where condition?



On Fri, Sep 1, 2017 at 11:37 PM, Billy Liu <[email protected]> wrote:

> 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
>>
>>
>


-- 
Yuxiang Mai
Sun Yat-Sen Unitversity
State Key Lab of Optoelectronic
Materials and Technologies

Reply via email to