TO_JSON (Lakehouse v2)
Convertit une valeur SQL en valeur JSON.
Syntaxe Analyze
Section intitulée « Syntaxe Analyze »func.to_json(get_column(table, 'struct_col'))Exemples Analyze
Section intitulée « Exemples Analyze »func.to_json(func.named_struct('name', 'Alice', 'age', 30))
┌───────────────────────────┐│ {"name":"Alice","age":30} │└───────────────────────────┘Syntaxe SQL
Section intitulée « Syntaxe SQL »TO_JSON(<struct_col>)Exemples SQL
Section intitulée « Exemples SQL »SELECT TO_JSON(NAMED_STRUCT('name', 'Alice', 'age', 30));
┌───────────────────────────┐│ {"name":"Alice","age":30} │└───────────────────────────┘