
Explanation:
The FROM_JSON function is used to convert a JSON string into a Struct data type. It requires the JSON string and the schema of the JSON as arguments. The syntax is from_json(jsonStr, schema [, options]), where jsonStr is a STRING expression specifying a row of JSON data, schema is a STRING literal or invocation of schema_of_json function, and options is an optional MAP literal specifying directives. For more details, refer to the documentation.
Which function is used to convert a JSON string into a Struct data type in Databricks SQL?
A
TO_STRUCT (json value)
B
FROM_JSON (json value, schema of json)
C
CONVERT (json value, schema of json)
D
CAST (json value as STRUCT)
E
FROM_JSON (json value)
No comments yet.