Skip to main content

some

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

Syntax

Python
from pyspark.sql import functions as sf

sf.some(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
import pyspark.sql.functions as sf
spark.createDataFrame(
[[True], [False], [True]], ["flag"]
).select(sf.some("flag")).show()
Output
+----------+
|some(flag)|
+----------+
| true|
+----------+
Python
import pyspark.sql.functions as sf
spark.createDataFrame(
[[False], [False], [False]], ["flag"]
).select(sf.some("flag")).show()
Output
+----------+
|some(flag)|
+----------+
| false|
+----------+