Difference between filter and where in scala spark sql

前端 未结 3 1065
鱼传尺愫
鱼传尺愫 2020-12-31 02:14

I\'ve tried both but it works same

example

val items =  List(1, 2, 3)

using filter

employees.filter($\"emp_id\".         


        
3条回答
  •  南笙
    南笙 (楼主)
    2020-12-31 02:42

    where documentation:

    Filters rows using the given condition. This is an alias for filter.

    filter is simply the standard Scala (and FP in general) name for such a function, and where is for people who prefer SQL.

提交回复
热议问题