Mathematical functions, or arithmetic functions, perform numeric calculations that are typically more complex than basic addition, subtraction, multiplication, and division. For example, these functions include trigonometric, logarithmic, and base conversion operations.
The mathematical functions operate mainly on these data types:
Functions that perform bitwise operations are explained in
Function reference:
Impala supports the following mathematical functions:
Usage notes: Use this function to ensure all return values are positive. This is different than
the
Return type:
Return type:
Return type:
Return type:
Return type:
Return type:
Return type:
Return type:
Return type:
Return type:
Return type:
Return type:
Return type:
Usage notes: You can use either the
Return type:
Return type:
Return type:
Because this function operates on
The following examples show equivalent operations with the
The following examples show operations with the
Return type:
You might use the return value in an application where you perform load balancing, bucketing, or some other technique to divide processing or storage.
Because the result can be any 64-bit value, to restrict the value to a particular range, you can use an
expression that includes the
This function implements the same algorithm that Impala uses internally for hashing, on systems where the CRC32 instructions are not available.
This function implements the
Similar input values of different types could produce different hash values, for example the same
numeric value represented as
For short argument values, the high-order bits of the result have relatively low entropy:
Added in: Impala 1.2.2
Return type:
inf, signifying infinity.
Return type:
NaN, signifying
not a number.
Return type:
Return type:
Return type:
Return type:
Return type:
Return type: The same as the integral type being checked.
Usage notes: Use the corresponding
Return type: The same as the integral type being checked.
Usage notes: Use the corresponding
Because this function works with
The following examples show how the
Usage notes: Use
Return type:
Return type:
The following examples show how the
Usage notes: Use
Return type:
Typically used in combination with the
Return type:
Return type:
Return type:
Return type:
Usage notes: Currently, the random sequence is reset after each query, and multiple calls to
The following examples show how
Return type:
Typically used in combination with the
Return type:
Return type:
Return type:
Return type:
Return type:
Return type:
Return type:
Return type:
Return type: