หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
Returns true if at least one value of col is true.
Syntax
from pyspark.sql import functions as sf
sf.bool_or(col)
Parameters
| Parameter | Type | Description |
|---|---|---|
col |
pyspark.sql.Column or column name |
Column to check if at least one value is true. |
Returns
pyspark.sql.Column: true if at least one value of col is true, false otherwise.
Examples
df = spark.createDataFrame([[True], [True], [True]], ["flag"])
df.select(bool_or("flag")).show()
+-------------+
|bool_or(flag)|
+-------------+
| true|
+-------------+
df = spark.createDataFrame([[False], [False], [False]], ["flag"])
df.select(bool_or("flag")).show()
+-------------+
|bool_or(flag)|
+-------------+
| false|
+-------------+