+1 vote
1 view
in Big Data Hadoop & Spark by (20.4k 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 (51k 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:_*))

 

...