Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Return Type

Name(Signature)

Description

T

if(boolean testCondition, T valueTrue, T valueFalseOrNull)

Returns valueTrue when testCondition is true, returns valueFalseOrNull otherwise.

booleanisnull( a )Returns true if a is NULL and false otherwise.
booleanisnotnull ( a )Returns true if a is not NULL and false otherwise.
Tnvl(T value, T default_value)Returns default value if value is null else returns value (as of HIve 0.11).

T

COALESCE(T v1, T v2, ...)

Returns the first v that is not NULL, or NULL if all v's are NULL.

T

CASE a WHEN b THEN c [WHEN d THEN e]* [ELSE f] END

When a = b, returns c; when a = d, returns e; else returns f.

T

CASE WHEN a THEN b [WHEN c THEN d]* [ELSE e] END

When a = true, returns b; when c = true, returns d; else returns e.

Tnullif( a, b )

Returns NULL if a=b; otherwise returns a (as of Hive 2.2.0).

Shorthand for: CASE WHEN a = b then NULL else a

 assert_true (boolean condition)Throw an exception if 'condition' is not true, otherwise return null (void). For example select assert_true (2<1)

String Functions

The following built-in String functions are supported in Hive:

...