หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
Returns true if the XPath expression evaluates to true, or if a matching node is found.
Syntax
from pyspark.sql import functions as sf
sf.xpath_boolean(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></a>',)], ['x'])
df.select(sf.xpath_boolean(df.x, sf.lit('a/b'))).show()
+---------------------+
|xpath_boolean(x, a/b)|
+---------------------+
| true|
+---------------------+