Comparison of two dates – Apache Hive & Apache Impala

There will be some situations where we need to compare two dates during the data analysis, to verify how many specified time intervals exist between them. The comparison can be to identify the number of days, weeks, and months between the dates specified.

  • Note: The below specified functions are common in both Apache Hive & Apache Impala.

DATEDIFF function is Apache Hive, behaves almost same as in relational systems such as MySQL and SQL Server. Only limitation is it accepts only two parameters and returns number of days between two dates.

DateDiff in Hive2

Hope you liked this post.

Please click on the follow button to receive notifications on latest posts.


Leave a Reply

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

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

Facebook photo

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

Connecting to %s