Scalar function
A typed NULL reports its declared type. An untyped NULL reports void.
Syntax
Scalar
Arguments
Returns
- Type: STRING
- Possible values: A lowercased SQL/DDL-style type description.
- NULL behavior: A typed NULL reports its declared type. An untyped NULL reports void.
Properties
Usage notes
- The result depends on the declared argument type, not its row value. Nested arrays/maps/structs are rendered recursively.
- VARIANT storage is recognized before ordinary structs.
- 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.
- Deterministic: The same inputs and settings produce the same result.
Examples
Typical behavior
Limitations
- DECIMAL types currently raise an error. This also applies to DECIMAL values nested inside ARRAY, MAP, or STRUCT.
- Some less common types return descriptive names that cannot be used directly in a SQL type declaration.
- DECIMAL input currently raises an execution error; cast it to an explicitly chosen nondecimal type before calling TYPEOF.
Last modified on October 15, 2026