schema_of_json
function
Applies to: Databricks SQL
Databricks Runtime
Returns the schema of a JSON
string in DDL format.
Arguments
jsonStr
: ASTRING
expression with aJSON
string.options
: An optional MAP literals with keys and values beingSTRING
.
Returns
A STRING
holding a definition of an array of structs with n
fields of strings where the column names are derived from the JSON
keys.
The field values hold the derived formatted SQL types.
For details on options, see from_json function.