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

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

public class UDFYear
extends UDF

UDFYear.


Constructor Summary
UDFYear()
           
 
Method Summary
 org.apache.hadoop.io.IntWritable evaluate(DateWritable d)
           
 org.apache.hadoop.io.IntWritable evaluate(org.apache.hadoop.io.Text dateString)
          Get the year from a date string.
 org.apache.hadoop.io.IntWritable evaluate(TimestampWritable t)
           
 
Methods inherited from class org.apache.hadoop.hive.ql.exec.UDF
getRequiredFiles, getRequiredJars, getResolver, setResolver
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UDFYear

public UDFYear()
Method Detail

evaluate

public org.apache.hadoop.io.IntWritable evaluate(org.apache.hadoop.io.Text dateString)
Get the year 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 1 to 12. null if the dateString is not a valid date string.

evaluate

public org.apache.hadoop.io.IntWritable evaluate(DateWritable d)

evaluate

public org.apache.hadoop.io.IntWritable evaluate(TimestampWritable t)


Copyright © 2014 The Apache Software Foundation. All rights reserved.