xpath_boolean

XPath ifadesi true olarak değerlendirilirse veya eşleşen bir düğüm bulunursa true döndürür.

Sözdizimi

from pyspark.sql import functions as sf

sf.xpath_boolean(xml, path)

Parametreler

Parametre Türü Description
xml pyspark.sql.Column veya str XML sütunu veya sütun adı.
path pyspark.sql.Column veya str XPath ifadesi.

Örnekler

from pyspark.sql import functions as sf
df = spark.createDataFrame([('<a><b>1</b></a>',)], ['x'])
df.select(sf.xpath_boolean(df.x, sf.lit('a/b'))).show()
+---------------------+
|xpath_boolean(x, a/b)|
+---------------------+
|                 true|
+---------------------+