RoyTao
RoyTao

Reputation: 61

How to use IFNULL function in hive?

As we all know ,we can use ifnull function in mysql,but there is no ifnull function in hive ,so how can we use some other function to substitute it

Upvotes: 3

Views: 12361

Answers (2)

rmutalik
rmutalik

Reputation: 2045

You can use the COALESCE or nvl function.

Source -> https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF.

Search for "Conditional Functions" and you will find all of the function definitions in that section.

Upvotes: 5

saravanatn
saravanatn

Reputation: 630

NULLIF is available in Hive(2.3.0) version on wards.

Search NULLIF in https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF link.

Upvotes: -2

Related Questions