I want to filter a DataFrame
using a condition related to the length of a column, this question might be very easy but I didn\'t find any related question in th
Here is an example for String in scala:
val stringData = Seq(("Maheswara"), ("Mokshith"))
val df = sc.parallelize(stringData).toDF
df.where((length($"value")) <= 8).show
+--------+
| value|
+--------+
|Mokshith|
+--------+
df.withColumn("length", length($"value")).show
+---------+------+
| value|length|
+---------+------+
|Maheswara| 9|
| Mokshith| 8|
+---------+------+