org.apache.hadoop.hive.ql.udf
Class UDFDateAdd

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.UDF
      extended by org.apache.hadoop.hive.ql.udf.UDFDateAdd

public class UDFDateAdd
extends UDF


Constructor Summary
UDFDateAdd()
           
 
Method Summary
 String evaluate(String dateString1, int days)
          Add a number of days to the date.
 
Methods inherited from class org.apache.hadoop.hive.ql.exec.UDF
getResolver, setResolver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UDFDateAdd

public UDFDateAdd()
Method Detail

evaluate

public String evaluate(String dateString1,
                       int days)
Add a number of days to the date. The time part of the string will be ignored. NOTE: This is a subset of what MySQL offers as: http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-add

Parameters:
dateString1 - the date string in the format of "yyyy-MM-dd HH:mm:ss" or "yyyy-MM-dd".
days - The number of days to add.
Returns:
the date in the format of "yyyy-MM-dd".


Copyright © 2009 The Apache Software Foundation