NAMED_STRUCT
Learn how to use the NAMED_STRUCT struct function in PlaidCloud Lakehouse. Creates a struct with specified field names and values - with syntax and examples.
Creates a struct with specified field names and values.
Analyze Syntax
func.named_struct(<name1>, <val1>[, <name2>, <val2>, ...])
Analyze Examples
func.named_struct('name', 'Alice', 'age', 30)
┌───────────────────────────┐
│ {'name':'Alice','age':30} │
└───────────────────────────┘
SQL Syntax
NAMED_STRUCT(<name1>, <val1>[, <name2>, <val2>, ...])
SQL Examples
SELECT NAMED_STRUCT('name', 'Alice', 'age', 30);
┌───────────────────────────┐
│ {"name":"Alice","age":30} │
└───────────────────────────┘