filter는 dataframe에서 where를 spark sql에서 사용하는데, 

이 둘의 차이가 무엇일까 살펴봤더니..


where는 filter의 앨리어스라 한다.




https://spark.apache.org/docs/1.5.2/api/scala/index.html#org.apache.spark.sql.DataFrame


defwhere(condition: Column)DataFrame

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




결국은 아래 함수의 결과는 동일하다.


employee.filter($"age" > 15)

employee.where($"age" > 15)

'scala' 카테고리의 다른 글

[spark] zipWithIndex, for-yield 예제  (0) 2017.05.25
[spark] join 예제  (0) 2017.05.23
[spark2] spark SQL 예제  (0) 2017.05.20
[spark2] spark2 rdd 생성 -makeRDD  (0) 2017.04.29
[scala] 라인 피드("\n") 관련 예시 코드  (0) 2017.04.24
Posted by '김용환'
,