Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Check if a variant value is a variant null. Returns true if and only if the input is a variant null and false otherwise (including in the case of SQL NULL).
Syntax
from pyspark.sql import functions as sf
sf.is_variant_null(v)
Parameters
| Parameter | Type | Description |
|---|---|---|
v |
pyspark.sql.Column or str |
A variant column or column name. |
Returns
pyspark.sql.Column: a boolean column indicating whether the variant value is a variant null
Examples
from pyspark.sql import functions as sf
df = spark.createDataFrame([ {'json': '''{ "a" : 1 }'''} ])
df.select(sf.is_variant_null(sf.parse_json(df.json)).alias("r")).collect()
[Row(r=False)]