Scalar function
NULL inputs become NULL fields inside the non-NULL constructed STRUCT.
Syntax
Scalar
- Use the Databricks SQL dialect for ROW construction. The E6 dialect rejects this expression context.
Arguments
Returns
- Type: STRUCT with the argument field types
- NULL behavior: NULL inputs become NULL fields inside the non-NULL constructed STRUCT.
- Shape: One STRUCT field per argument, preserving each argument type.
- Ordering: Field order follows argument order.
Properties
Usage notes
- Fields are named c0, c1, and so on.
- 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
- Requires the Databricks SQL dialect. Explicit ROW constructors are not accepted in the default E6 dialect.
Fields with different types
Requires the Databricks SQL dialect.
Limitations
- Query tools may report or display different field names. The field names described above are those of the returned value.
Last modified on October 15, 2026