
Databricks Certified Data Engineer - Associate
Get started today
Ultimate access to all questions.
Which function is used to convert a JSON string into a Struct data type in Databricks SQL?
Which function is used to convert a JSON string into a Struct data type in Databricks SQL?
Real Exam
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.