Nota
L-aċċess għal din il-paġna jeħtieġ l-awtorizzazzjoni. Tista’ tipprova tidħol jew tibdel id-direttorji.
L-aċċess għal din il-paġna jeħtieġ l-awtorizzazzjoni. Tista’ tipprova tibdel id-direttorji.
Applies to:
Databricks SQL
Databricks Runtime 14.1 and above
Important
This feature is in Public Preview. You can confirm preview enrollment on the Previews page. See Manage Azure Databricks previews.
Returns the schema of an XML string in DDL format.
Syntax
schema_of_xml(xmlStr [, options] )
Arguments
xmlStr: ASTRINGexpression with aXMLstring.options: An optionalMAP<STRING, STRING>literal.
Returns
A STRING holding a definition of struct where the column names are derived from the XML element and attribute names.
The field values hold the derived formatted SQL types.
For details on options, see from_xml function.
Examples
> SELECT schema_of_xml('<p><a>1</a></p>');
STRUCT<a: BIGINT>
> SELECT schema_of_xml('<p><a attr="2">1</a><a>3</a></p>', map('excludeAttribute', 'true'));
STRUCT<a: ARRAY<BIGINT>>