I\'m trying to filter a Spark DataFrame using a list in Java.
java.util.List selected = ....; DataFrame result = df.filter(df.col(\"something\").
Use stream method as follows:
stream
df.filter(col("something").isin(selected.stream().toArray(String[]::new))))
A bit shorter version would be:
df.filter(col("something").isin(selected.toArray()));