org.apache.hadoop.hive.ql.udf
Class UDFUnixTimeStamp
java.lang.Object
org.apache.hadoop.hive.ql.exec.UDF
org.apache.hadoop.hive.ql.udf.UDFUnixTimeStamp
public class UDFUnixTimeStamp
- extends UDF
UDFUnixTimeStamp.
Method Summary |
LongWritable |
evaluate()
Return current UnixTime. |
LongWritable |
evaluate(Text dateText)
Convert time string to UnixTime. |
LongWritable |
evaluate(Text dateText,
Text patternText)
Convert time string to UnixTime with user defined pattern. |
LongWritable |
evaluate(TimestampWritable i)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UDFUnixTimeStamp
public UDFUnixTimeStamp()
evaluate
public LongWritable evaluate()
- Return current UnixTime.
- Returns:
- long Number of seconds from 1970-01-01 00:00:00
evaluate
public LongWritable evaluate(Text dateText)
- Convert time string to UnixTime.
- Parameters:
dateText
- Time string in format yyyy-MM-dd HH:mm:ss
- Returns:
- long Number of seconds from 1970-01-01 00:00:00
evaluate
public LongWritable evaluate(Text dateText,
Text patternText)
- Convert time string to UnixTime with user defined pattern.
- Parameters:
dateText
- Time string in format patternstringpatternText
- Time patterns string supported by SimpleDateFormat
- Returns:
- long Number of seconds from 1970-01-01 00:00:00
evaluate
public LongWritable evaluate(TimestampWritable i)
Copyright © 2012 The Apache Software Foundation