Skip to main content

bool_or

Returns true if at least one value of col is true.

Syntax

Python
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

Python
df = spark.createDataFrame([[True], [True], [True]], ["flag"])
df.select(bool_or("flag")).show()
Output
+-------------+
|bool_or(flag)|
+-------------+
| true|
+-------------+
Python
df = spark.createDataFrame([[False], [False], [False]], ["flag"])
df.select(bool_or("flag")).show()
Output
+-------------+
|bool_or(flag)|
+-------------+
| false|
+-------------+