Saturday, 3 December 2016
Multiple Filters in a Spark DataFrame column using Scala
To filter a single DataFrame column with multiple values
Filter using Spark.Sql
DataFrame.registerTempTable("tempDfTable")
SqlContext.Sql("""Select * from tempDfTable where tempDfTable.column=1 and tempDfTable.column!=0 """)
Filter a DataFrame column directly
DataFrame.filter(col("column1").equalTo(1) && col("column1").equalTo(not(0)))
Filter using $
Before using $ symbol import namespace - import sql.implicits_
DataFrame.filter($("column1" == 1))
Subscribe to:
Post Comments
(
Atom
)
Multiple Filters In A Spark Dataframe Column Using Scala >>>>> Download Now
ReplyDelete>>>>> Download Full
Multiple Filters In A Spark Dataframe Column Using Scala >>>>> Download LINK
>>>>> Download Now
Multiple Filters In A Spark Dataframe Column Using Scala >>>>> Download Full
>>>>> Download LINK