[ https://issues.apache.org/jira/browse/HIVE-5810?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13820958#comment-13820958 ]
Anandha L Ranganathan commented on HIVE-5810: --------------------------------------------- The existing function date_add only able to add based on days. SELECTdae_add('2009-30-07', 1) FROM src LIMIT 1;\n" + " '2009-31-07'") Here is mysql example, http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_adddate. > create a function ADDDATE as exists in mysql > ----------------------------------------------- > > Key: HIVE-5810 > URL: https://issues.apache.org/jira/browse/HIVE-5810 > Project: Hive > Issue Type: Improvement > Reporter: Anandha L Ranganathan > Assignee: Anandha L Ranganathan > Original Estimate: 40h > Remaining Estimate: 40h > > MySQL has ADDDATE(date,INTERVAL expr unit). > Similarly in Hive we can have (date,unit,expr). > For example, > ADDDATE('2013-11-09','DAY',2) will return 2013-11-11. > ADDDATE('2013-11-09','Month',2) will return 2014-01-11. > ADDDATE('2013-11-09','Year',2) will return 2014-11-11. > Here Unit is DAY/Month/Year -- This message was sent by Atlassian JIRA (v6.1#6144)