Hi

If(ISNOTNULL(sum(columnname), sum(columnname),0) as sumVendor
Or
*coalesce( sum(columnname),0) as ...*

   As explained here 
<https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF>,
   COALESCE(T v1, T v2, ...) Returns the first v that is not NULL, or NULL if 
all v's are NULL.


hth
GB

On 6/3/2015 2:23 AM, Teja Kunapareddy wrote:

Ravi,

Use if condition .. it works ..

Use    ISNOTNULL  instead, and give the replace field as third parameter for if 
condition…

NOTE: false and null are together in if condition

If(ISNOTNULL(sum(columnname), sum(columnname),0) as sumVendor

Regards,

Teja


--
The statements and opinions expressed here are my own and do not necessarily 
represent those of Oracle Corporation.

Reply via email to