Get started
Load & manage data
Work with data
Administration
Reference & resources
CLUSTER BY
mask
ROW FILTER
Updated Dec 20, 2024
Send us feedback
named_struct
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.
nameN
valN: An expression of any type specifying the value for field N.
valN
A struct with field N matching the type of valN.
> SELECT named_struct('a', 1, 'b', 2, 'c', 3); {"a":1,"b":2,"c":3}
struct function
map function
str_to_map function
array function