I have a dataframe(df) with following:
+---------+--------------------+
| col1| col2 |
+---------+--------------------+
|colvalue1| NULL|
|colvalue2|col2value... |
+------------+-----------------+
I am trying to filter rows based on the col2 as follows
df.filter(($"col2".isNotNULL) || ($"col2" !== "NULL") || ($"col2" !== "null") || ($"col2".trim !== "NULL"))
But the row which has NULL is not filtering. This column show nullable=true
.
Can anyone let me know what mistake I am doing? I am using Spark 1.6.