org.apache.hadoop.hive.ql.udf
Class UDFDateDiff
java.lang.Object
org.apache.hadoop.hive.ql.exec.UDF
org.apache.hadoop.hive.ql.udf.UDFDateDiff
public class UDFDateDiff
- extends UDF
UDFDateDiff.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UDFDateDiff
public UDFDateDiff()
evaluate
public IntWritable evaluate(Text dateString1,
Text dateString2)
- Calculate the difference in the number of days. The time part of the string
will be ignored. If dateString1 is earlier than dateString2, then the
result can be negative.
- Parameters:
dateString1
- the date string in the format of "yyyy-MM-dd HH:mm:ss" or
"yyyy-MM-dd".dateString2
- the date string in the format of "yyyy-MM-dd HH:mm:ss" or
"yyyy-MM-dd".
- Returns:
- the difference in days.
evaluate
public IntWritable evaluate(TimestampWritable t1,
TimestampWritable t2)
evaluate
public IntWritable evaluate(TimestampWritable t,
Text dateString)
evaluate
public IntWritable evaluate(Text dateString,
TimestampWritable t)
evaluate
public IntWritable evaluate(Text dateString,
DateWritable d)
evaluate
public IntWritable evaluate(TimestampWritable t,
DateWritable d)
evaluate
public IntWritable evaluate(DateWritable d1,
DateWritable d2)
evaluate
public IntWritable evaluate(DateWritable d,
Text dateString)
evaluate
public IntWritable evaluate(DateWritable d,
TimestampWritable t)
Copyright © 2012 The Apache Software Foundation