How to find specific data of particular column in dataframe via spark scala
Solution:
//Consider, load data frame
val df = spark.read.format("csv").option("header","True").load("file:////home/cloudera/first_last.txt")
df.show()
//Find data of list
val namesToTest = List("John","Brown")
//filter data from particular columns in dataframe
val filter_df = df.filter(col("Last_name").isin(namesToTest:_*))
filter_df.show()
Comments
Post a Comment