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

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

public class UDFDateSub
extends UDF

UDFDateSub.


Constructor Summary
UDFDateSub()
           
 
Method Summary
 Text evaluate(Text dateString1, IntWritable days)
          Subtract a number of days to the date.
 Text evaluate(TimestampWritable t, IntWritable days)
           
 
Methods inherited from class org.apache.hadoop.hive.ql.exec.UDF
getRequiredFiles, getRequiredJars, getResolver, setResolver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UDFDateSub

public UDFDateSub()
Method Detail

evaluate

public Text evaluate(Text dateString1,
                     IntWritable days)
Subtract 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-sub

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 subtract.
Returns:
the date in the format of "yyyy-MM-dd".

evaluate

public Text evaluate(TimestampWritable t,
                     IntWritable days)


Copyright © 2012 The Apache Software Foundation