Hive supports three types of conditional functions. These functions are listed below:


IF( Test Condition, True Value, False Value ) 
The IF condition evaluates the “Test Condition” and if the “Test Condition” is true, then it returns the “True Value”. Otherwise, it returns the False Value.
Example: IF(1=1, 'working', 'not working') returns 'working'

COALESCE( value1,value2,... )

The COALESCE function returns the fist not NULL value from the list of values. If all the values in the list are NULL, then it returns NULL.
Example: COALESCE(NULL,NULL,5,NULL,4) returns 5

相关文章:

  • 2022-12-23
  • 2021-11-13
  • 2021-10-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-06
  • 2022-12-23
猜你喜欢
  • 2021-11-13
  • 2021-05-04
  • 2021-06-26
  • 2021-07-05
  • 2022-12-23
  • 2021-07-17
  • 2022-01-14
相关资源
相似解决方案