Notiz
Zougrëff op dës Säit erfuerdert Autorisatioun. Dir kënnt probéieren, Iech unzemellen oder Verzeechnesser ze änneren.
Zougrëff op dës Säit erfuerdert Autorisatioun. Dir kënnt probéieren, Verzeechnesser ze änneren.
Returns same result as the EQUAL(=) operator for non-null operands, but returns true if both are null, false if one of them is null.
For the corresponding Databricks SQL function, see equal_null function.
Syntax
from pyspark.sql import functions as dbf
dbf.equal_null(col1=<col1>, col2=<col2>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col1 |
pyspark.sql.Column or str |
The first column to compare. |
col2 |
pyspark.sql.Column or str |
The second column to compare. |
Examples
from pyspark.sql import functions as dbf
df = spark.createDataFrame([(None, None,), (1, 9,)], ["a", "b"])
df.select('*', dbf.equal_null(df.a, df.b)).show()
+----+----+----------------+
| a| b|equal_null(a, b)|
+----+----+----------------+
|NULL|NULL| true|
| 1| 9| false|
+----+----+----------------+