Adding Days To A Date – Apache Impala

The ADDDATE function in Apache Impala is equivalent to the DATEADD function in most RDBMSs. This function is widely used for data analysis and business logic implementations. This function’s goal is to add a certain number of days to a TIMESTAMP column/value.

Example:
SELECT NOW() AS CurrentDate, ADDDATE(NOW(), 30) DateAfter30Days;
….—…………CurrentDate…………….|………..–.DateAfter30Days–………..
 2021-10-30 09:15:41.895351000 | 2021-11-29 09:15:41.895351000

SELECT NOW() AS CurrentDate, ADDDATE(NOW(), 1) DateAfter1Day;
….—…………CurrentDate…………….|………..–.DateAfter1Day–..–………
2021-10-30 09:15:41.895351000 | 2021-10-31 09:15:41.895351000

I hope you found this post to be informative.

Please join our mailing list to receive more interesting information.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s