Signature
coalesce(value1,value2,...)
Return first non-null value from the given values. If all the values are null, then it return null.
hive> SELECT coalesce('Krishna', null, null);
OK
_c0
Krishna
Time taken: 0.042 seconds, Fetched: 1 row(s)
hive> ;
hive> ;
hive> SELECT coalesce(null, 'Ram', 'Krishna', null, null);
OK
_c0
Ram
Time taken: 0.05 seconds, Fetched: 1 row(s)
hive> ;
hive> ;
hive> SELECT coalesce(null, null, null);
OK
_c0
NULL
Time taken: 0.039 seconds, Fetched: 1 row(s)
No comments:
Post a Comment