Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Big Data Hadoop & Spark by (19k points)

I am filtering the Spark DataFrame using 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 (33.1k points)

Simply use the function as following:

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

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

I hope this answer would help you!

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...