How to use Column.isin with list?

后端 未结 5 1589
眼角桃花
眼角桃花 2020-11-29 06:00
val items = List(\"a\", \"b\", \"c\")

sqlContext.sql(\"select c1 from table\")
          .filter($\"c1\".isin(items))
          .collect
          .foreach(println)         


        
5条回答
  •  借酒劲吻你
    2020-11-29 06:05

    Spark has now (since 2.4.0) a method called isInCollection, which is just what you are looking for, instead of isIn.

    (shouldn't they unify the methods?)

提交回复
热议问题