Reputation: 1
Im new on Spark, I need help on how I can use IN Condition in sparkSQL
SELECT name,age WHERE age IN (25,35,45) FROM table
Upvotes: 0
Views: 1861
Reputation: 444
This should work df.where(col('age').isin([25, 35, 45)).select('name', 'age')
For reference, see the spark documentation
Upvotes: 1