From the course: Analyzing Big Data with Hive

Unlock the full course today

Join today to access over 24,200 courses taught by industry experts.

Date functions

Date functions

- [Narrator] So at this point you've heard me talk about dates and how they're special. Here, we're going to dive into working with dates in Hive. Now Hive has date functions, just like all data platforms do. And these functions handle different date formats, and perform operations on dates, such as addition and subtraction. What we're going to do to start, is find the difference between two dates, a simple operation. Then, we'll calculate monthly aggregations, using a date value. And lastly, we'll find the last day of the month from a given day. Here in my clutter environment, I'm going to open up my scripts and we're looking at seven dash four. I'm going to copy this into my editor. And we'll start by just finding the difference between two dates. So, here we have our project complete date and our order date, so we're going to use the date diff function, which will tell us the number of days between those two. That would be in our case as a consulting company with our sales data…

Contents