Partager via


xpath_float Fonction

S’applique à :coché Databricks SQL coché Databricks Runtime

Retourne une valeur FLOAT à partir d’un document XML.

Syntaxe

xpath_float(xml, xpath)

Les arguments

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

retourne :

Le résultat est FLOAT.

Le résultat est zéro si aucune correspondance n’est trouvée, ou NaN si la valeur d’une correspondance trouvée n’est pas numérique.

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

Exemples

> SELECT xpath_float('<a><b>1</b><b>2</b></a>', 'sum(a/b)');
 3.0