I'm trying to filter data between September 1st, 2010 and August 31st, 2013 in a Hive table. The column containing the date is in string format (yyyy-mm-dd). I can use month() and year() on this column. But how do I use them to filter data between the above dates? Any examples/sample code would be welcome!
Just like SQL, Hive supports BETWEEN operator for more concise statement:
SELECT * FROM your_table WHERE your_date_column BETWEEN '2010-09-01' AND '2013-08-31';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With