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
|`<json>`| The JSON string to check the type of. |
38
-
|`<json_path>`| JSON path, which specifies the location of the field in JSON. The path is usually given in $. At the beginning, use. to represent the hierarchical structure. |
31
+
## Parameters
39
32
33
+
-`<json>` The JSON string to check the type of.
34
+
-`<json_path>` String type, which specifies the location of the field in JSON. The path is usually given in $. At the beginning, use. to represent the hierarchical structure.
40
35
41
36
## Return Value
42
-
Returns the type of the JSON string. Possible values include:
43
-
- "NULL": Indicates that the value in the JSON document is null.
44
-
- "BOOLEAN": Indicates that the value in the JSON document is of boolean type (true or false).
45
-
- "NUMBER": Indicates that the value in the JSON document is a number.
46
-
- "STRING": Indicates that the value in the JSON document is a string.
47
-
- "OBJECT": Indicates that the value in the JSON document is a JSON object.
48
-
- "ARRAY": Indicates that the value in the JSON document is a JSON array.
49
37
50
-
## Usage Notes
38
+
`Nullable<String>`: Returns the type of the corresponding field.
51
39
52
-
JSON_TYPE returns the type of the outermost value in the JSON document. If the JSON document contains multiple different types of values, it will return the type of the outermost value. For invalid JSON strings, JSON_TYPE returns NULL. Refer to [json tutorial](../../../basic-element/sql-data-types/semi-structured/JSON)
40
+
## Usage Notes
41
+
- If `<json_object>` or `<json_path>` is NULL, returns NULL.
42
+
- If `<json_path>` is not a valid path, the function reports an error.
43
+
- If the field specified by `<json_path>` does not exist, returns NULL.
Copy file name to clipboardExpand all lines: i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/json-functions/json-type.md
0 commit comments