Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
2 views
in Big Data Hadoop & Spark by (47.6k points)

I am filtering the Spark DataFrame using the filter:

var notFollowingList=List(9.8,7,6,3,1)

df.filter(col("uid”).isin(notFollowingList))

But I get an error saying:

Unsupported literal type classscala.collection.immutable.$colon$colon 

Can anyone help me in resolving the error?

1 Answer

0 votes
by (106k points)

Use the function as following piece of code to filter:

var notFollowingList=List(9.8,7,6,3,1)

df.filter(col("uid").isin(notFollowingList:_*))

 

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...