티스토리 뷰

공부

[Spark] SQL datediff

승가비 2020. 8. 11. 17:09
728x90
SELECT datediff(TO_DATE('20200501', 'yyyyMMdd'),TO_DATE('20200701', 'yyyyMMdd'))

https://stackoverflow.com/questions/46304245/how-to-get-months-years-difference-between-two-dates-in-sparksql

 

how to get months,years difference between two dates in sparksql

I am getting the error: org.apache.spark.sql.analysisexception: cannot resolve 'year' My input data: 1,2012-07-21,2014-04-09 My code: val sqlContext = new org.apache.spark.sql.SQLContext(sc) ...

stackoverflow.com

 

728x90
댓글