org.apache.hadoop.hive.ql.udf
Class UDFHour
java.lang.Object
org.apache.hadoop.hive.ql.exec.UDF
org.apache.hadoop.hive.ql.udf.UDFHour
public class UDFHour
- extends UDF
UDFHour.
Method Summary |
org.apache.hadoop.io.IntWritable |
evaluate(org.apache.hadoop.io.Text dateString)
Get the hour from a date string. |
org.apache.hadoop.io.IntWritable |
evaluate(TimestampWritable t)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UDFHour
public UDFHour()
evaluate
public org.apache.hadoop.io.IntWritable evaluate(org.apache.hadoop.io.Text dateString)
- Get the hour from a date string.
- Parameters:
dateString
- the dateString in the format of "yyyy-MM-dd HH:mm:ss" or
"yyyy-MM-dd".
- Returns:
- an int from 0 to 23. null if the dateString is not a valid date
string.
evaluate
public org.apache.hadoop.io.IntWritable evaluate(TimestampWritable t)
Copyright © 2013 The Apache Software Foundation