Impala supports the following conditional functions for testing equality, comparison operators, and nullity:
In this form of the
Although this example is split across multiple lines, you can put any or all parts of a
Small
,
Medium
and Large
based on ranges. Then subsequent parts of the
query might aggregate based on the transformed values, such as how many
values are classified as small, medium, or large. You can also use
By using operators such as
Because this flexible form of the
Although this example is split across multiple lines, you can put any or all parts of a
Can be used as shorthand for a
The original expression and the search expressions must of the same type or convertible types. The result expression can be a different type, but all result expressions must be of the same type.
Returns a successful match If the original expression is
Returns
The following example translates numeric day values into descriptive names:
Return type: Same as the
Compatibility notes: Equivalent to the
Return type: Same as the first argument value
Usage notes: This function is effectively shorthand for a
It is commonly used in division expressions, to produce a
You might also use it for compatibility with other database systems that support the same
Usage notes: Used to avoid error conditions such as divide-by-zero in numeric calculations.
Serves as shorthand for a more elaborate
Return type: Same as the first argument value
Return type: Same as the first argument value
The following examples show how a query can use special indicator values
to represent null and not-null expression values. The first example tests
an
Usage notes: Used to avoid unexpected results due to unexpected propagation of