How to select top N rows in Hive?
October 8, 2021What is the difference between EXPLODE and LATERAL VIEW EXPLODE in Hive?
October 15, 2021Comparing 2 dates is quite common when you deal with data. Hive has datediff function to help you compare 2 dates.
Solution
datediff function in Hive takes 2 dates in String type and gives you the difference between the dates.
datediff(string enddate, string startdate)
String dates should be in yyyy-MM-dd format
SELECT datediff('2009-03-01', '2009-02-27') 2 will be the output
1 Comment
[…] + Read More Here […]