6098/filtering-spark-dataframe-based-matching-values-from-list
Announcement! Career Guide 2019 is out now. Explore careers to become a Big Data Developer or Architect!
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?
Use the function as following:
var notFollowingList=List(9.8,7,6,3,1) df.filter(col("uid").isin(notFollowingList:_*))
You need isInCollection
Is it possible to filter Spark DataFrames to return all rows where a , How can I return only the rows of a Spark DataFrame where the values for a column are within a specified list? Here's my Python pandas way of How can I return only the rows of a Spark DataFrame where the values for a column are within a specified list? Here's my Python pandas way of doing this operation: df_start = df[df['name'].isin(['App Opened', 'App Launched'])].copy() I saw this SO scala implementation and tried several permutations, but couldn't get it to work.
Can you share the screenshots for the ...READ MORE
Hi, In Spark, fill() function of DataFrameNaFunctions class is used to replace ...READ MORE
Hey, You can try this: from pyspark import SparkContext SparkContext.stop(sc) sc ...READ MORE
spark do not have any concept of ...READ MORE
Instead of spliting on '\n'. You should ...READ MORE
JDBC is not required here. Create a hive ...READ MORE
Please check the below mentioned links for ...READ MORE
Spark has various components: Spark SQL (Shark)- for ...READ MORE
// Collect data from input avro file ...READ MORE
Yes, you can go ahead and write ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.