How to use NOT IN clause in filter condition in spark

前端 未结 3 1899
一整个雨季
一整个雨季 2021-02-04 06:09

I want to filter a column of an RDD source :

val source = sql(\"SELECT * from sample.source\").rdd.map(_.mkString(\",\"))
val destination = sql(\"select * from          


        
3条回答
  •  [愿得一人]
    2021-02-04 06:56

    You can try like--

    df.filter(~df.Dept.isin("30","20")).show() 
    

    //This will list all the columns of df where Dept NOT IN 30 or 20

提交回复
热议问题