Scalar function
Returns NULL for NULL input.
Syntax
String or array
Arguments
Type notation used below:
- T is the array element type: BOOLEAN, TINYINT, SMALLINT, INTEGER, BIGINT, FLOAT, DOUBLE, DECIMAL(p, s), STRING, BINARY, DATE, TIME, TIMESTAMP, ARRAY, MAP or STRUCT.
String
Array
Returns
- Type: STRING for string input; ARRAY<T> for array input
- Possible values: The input Unicode code points in reverse order.
- NULL behavior: Returns NULL for NULL input.
- Shape: String code points are reversed, or array length and element type are retained.
- Ordering: Reverse input encounter order.
Array
- Type: ARRAY<T>
- Possible values: The same elements in reverse order.
- NULL behavior: Returns NULL for NULL array; retains NULL elements.
- Shape: Same length and element type as the input.
- Ordering: Reverse input order.
Properties
Usage notes
- INTEGER and INT mean the same type; STRING means VARCHAR text. NULL can be used with a supported type. Cast NULL explicitly when its type would otherwise be unclear.
Examples
Typical behavior (string)
Typical behavior (array)
Last modified on October 15, 2026