TO_JSON (Lakehouse v2)
SQL値をJSON値に変換します。
Analyzeの構文
Section titled “Analyzeの構文”func.to_json(get_column(table, 'struct_col'))Analyzeの例
Section titled “Analyzeの例”func.to_json(func.named_struct('name', 'Alice', 'age', 30))
┌───────────────────────────┐│ {"name":"Alice","age":30} │└───────────────────────────┘SQLの構文
Section titled “SQLの構文”TO_JSON(<struct_col>)SELECT TO_JSON(NAMED_STRUCT('name', 'Alice', 'age', 30));
┌───────────────────────────┐│ {"name":"Alice","age":30} │└───────────────────────────┘