티스토리 뷰

공부

[Spark] SQL datediff

seunggabi 승가비 2020. 8. 11. 17:09
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

 

'공부' 카테고리의 다른 글

[Sh] check CentOS version  (0) 2020.08.21
[Linux] check process (port & service & kill)  (0) 2020.08.14
[Spark] SQL datediff  (0) 2020.08.11
[Java] convert integer to string with comma for thousands  (0) 2020.08.11
[Python] pretty print JSON  (0) 2020.08.10
[Presto] month ago  (0) 2020.08.10
댓글
댓글쓰기 폼