Nota
Capaian ke halaman ini memerlukan kebenaran. Anda boleh cuba mendaftar masuk atau menukar direktori.
Capaian ke halaman ini memerlukan kebenaran. Anda boleh cuba menukar direktori.
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|
+-------------+