Aller au contenu principal

isnotnull

Renvoie true si col n’est pas nul, ou false dans le cas contraire.

Pour la fonction Databricks SQL correspondante, consultez la fonctionisnotnull.

Syntaxe

Python
from pyspark.sql import functions as dbf

dbf.isnotnull(col=<col>)

parameter

parameter

Type

Description

col

pyspark.sql.Column OU str

La colonne à vérifier.

parameter

Type

Description

col

pyspark.sql.Column OU str

La colonne à vérifier.

Exemples

Python
from pyspark.sql import functions as dbf
df = spark.createDataFrame([(None,), (1,)], ["e"])
df.select('*', dbf.isnotnull(df.e)).show()
Output
+----+---------------+
| e|(e IS NOT NULL)|
+----+---------------+
|NULL| false|
| 1| true|
+----+---------------+