Fonction xpath

S’applique à :case marquée oui Databricks SQL case marquée oui Databricks Runtime

Retourne des valeurs dans les nœuds de xml qui correspondent à xpath.

Syntaxe

xpath(xml, xpath)

Arguments

  • xml : expression de type STRING de XML.
  • xpath : expression de type STRING qui est un XPath bien formé.

Retours

Un tableau (ARRAY) de chaîne (STRING).

La fonction génère une erreur si xml ou xpath sont malformés.

Exemples

> SELECT xpath('<a><b>b1</b><b>b2</b><b>b3</b><c>c1</c><c>c2</c></a>','a/b/text()');
 [b1, b2, b3]