You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Usage: `json_object(<key>, <value>[, <key>, <value>]...)` returns a JSON object from key-value pairs.
70
+
71
+
Argument type:
72
+
- A \<key\> must be STRING.
73
+
- A \<value\> can be a scalar, another json object, or json array type. Note: scalar fields will be treated as single-value. Use `json_array` to construct an array value from a multi-value.
74
+
75
+
Return type: STRUCT
76
+
77
+
Example:
78
+
79
+
os> source=people | eval result = json_object('key', 123.45) | fields result
80
+
fetched rows / total rows = 1/1
81
+
+------------------+
82
+
| result |
83
+
+------------------+
84
+
| {"key":123.45} |
85
+
+------------------+
86
+
87
+
os> source=people | eval result = json_object('outer', json_object('inner', 123.45)) | fields result
88
+
fetched rows / total rows = 1/1
89
+
+------------------------------+
90
+
| result |
91
+
+------------------------------+
92
+
| {"outer":{"inner":123.45}} |
93
+
+------------------------------+
94
+
95
+
os> source=people | eval result = json_object('array_doc', json_array(123.45, "string", true, null)) | fields result
0 commit comments