org.apache.hadoop.hive.ql.exec
Class UDF

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.UDF
Direct Known Subclasses:
UDFAscii, UDFBase64, UDFBaseBitOP, UDFBin, UDFConv, UDFDayOfMonth, UDFE, UDFFindInSet, UDFFromUnixTime, UDFHex, UDFHour, UDFJson, UDFLength, UDFLike, UDFMath, UDFMinute, UDFMonth, UDFOPLongDivide, UDFParseUrl, UDFPI, UDFRand, UDFRegExp, UDFRegExpExtract, UDFRegExpReplace, UDFRepeat, UDFReverse, UDFSecond, UDFSign, UDFSpace, UDFSubstr, UDFToBoolean, UDFToByte, UDFToDouble, UDFToFloat, UDFToInteger, UDFToLong, UDFToShort, UDFToString, UDFUnbase64, UDFUnhex, UDFWeekOfYear, UDFXPathBoolean, UDFXPathDouble, UDFXPathFloat, UDFXPathInteger, UDFXPathLong, UDFXPathShort, UDFXPathString, UDFYear

public class UDF
extends Object

A User-defined function (UDF) for the use with Hive. New UDF classes need to inherit from this UDF class. Required for all UDF classes: 1. Implement one or more methods named "evaluate" which will be called by Hive. The following are some examples: public int evaluate(); public int evaluate(int a); public double evaluate(int a, double b); public String evaluate(String a, int b, String c); "evaluate" should never be a void method. However it can return "null" if needed.


Constructor Summary
UDF()
          The constructor.
 
Method Summary
 String[] getRequiredFiles()
           
 String[] getRequiredJars()
          These can be overriden to provide the same functionality as the correspondingly named methods in GenericUDF.
 UDFMethodResolver getResolver()
          Get the method resolver.
 void setResolver(UDFMethodResolver rslv)
          Sets the resolver.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UDF

public UDF()
The constructor.

Method Detail

setResolver

public void setResolver(UDFMethodResolver rslv)
Sets the resolver.

Parameters:
rslv - The method resolver to use for method resolution.

getResolver

public UDFMethodResolver getResolver()
Get the method resolver.


getRequiredJars

public String[] getRequiredJars()
These can be overriden to provide the same functionality as the correspondingly named methods in GenericUDF.


getRequiredFiles

public String[] getRequiredFiles()


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