Using operators

Hive supports various built-in operators. There are four types of operator in Hive:

  • Relational operators
  • Arithmetic operators
  • Logical operators
  • Complex operators

Using relational operators

Relational operators are used to compare two operands. The output of comparison produces TRUE or FALSE depending on the comparison of operands.

The following table describes relational operators available in Hive:

Operator

Operand Type

Description

A = B

All primitive data types

This returns True if primitives are equal, otherwise False.

A != B

All primitive data types

This returns True if primitive A is not equal to B, False otherwise. It would return Null if A or B is NULL.

A <=> B

All primitive data types

This returns the same result as ...

Get Apache Hive Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.