Monday 14 November 2022

Hive: date_sub: subtract number of days from given date

Signature

date_sub(string date1, int noOfDays)
hive> SELECT date_sub('2021-05-12', 5);
OK
_c0
2021-05-07
Time taken: 0.046 seconds, Fetched: 1 row(s)
hive> ;
hive> SELECT date_sub('2021-05-12', -5);
OK
_c0
2021-05-17
Time taken: 0.042 seconds, Fetched: 1 row(s)

 

Previous                                                    Next                                                    Home

No comments:

Post a Comment