Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to:
Databricks SQL
Databricks Runtime
Creates a struct with the specified field names and values.
named_struct( {name1, val1} [, ...] )
nameN: A STRING literal naming field N.valN: An expression of any type specifying the value for field N.
A struct with field N matching the type of valN.
sql
> SELECT named_struct('a', 1, 'b', 2, 'c', 3);
{"a":1,"b":2,"c":3}