I have a dataframe where one column is ; separated strings, e.g. "str1;str2;str3;str4", I also have another static list "strx;stry;strz", the goal is to split the column string value and check if the split array has any intersection with the static list, and keep that row
I tried
df.where($"column".split(";").intersect(staticList).nonEmpty)
or df.where(split($"column", ";").intersect(staticList).nonEmpty)
or replace $"" with col()
or use $"".getString before calling split
I always get error split is not a member of org.apache.spark.sql.ColumnName, similar to getString. It appears the split is applied to a Column type instead of String type.
So my question is, during where or filter, how can I access the string value for a column and split it?
Thanks!!