Notiz
Zougrëff op dës Säit erfuerdert Autorisatioun. Dir kënnt probéieren, Iech unzemellen oder Verzeechnesser ze änneren.
Zougrëff op dës Säit erfuerdert Autorisatioun. Dir kënnt probéieren, Verzeechnesser ze änneren.
Returns an integer value, or the value zero if no match is found, or a match is found but the value is non-numeric.
Syntax
from pyspark.sql import functions as sf
sf.xpath_int(xml, path)
Parameters
| Parameter | Type | Description |
|---|---|---|
xml |
pyspark.sql.Column or str |
XML column or column name. |
path |
pyspark.sql.Column or str |
XPath expression. |
Examples
from pyspark.sql import functions as sf
df = spark.createDataFrame([('<a><b>1</b><b>2</b></a>',)], ['x'])
df.select(sf.xpath_int(df.x, sf.lit('sum(a/b)'))).show()
+----------------------+
|xpath_int(x, sum(a/b))|
+----------------------+
| 3|
+----------------------+