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

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.UDF
Direct Known Subclasses:
UDFBaseCompare, UDFBaseNumericOp, UDFCeil, UDFConcat, UDFDate, UDFDateAdd, UDFDateDiff, UDFDateSub, UDFDayOfMonth, UDFDefaultSampleHashFn, UDFExp, UDFFloor, UDFFromUnixTime, UDFIf, UDFJson, UDFLike, UDFLn, UDFLog, UDFLog10, UDFLog2, UDFLower, UDFLTrim, UDFMonth, UDFOPAnd, UDFOPBitAnd, UDFOPBitNot, UDFOPBitOr, UDFOPBitXor, UDFOPNegative, UDFOPNot, UDFOPNotNull, UDFOPNull, UDFOPOr, UDFOPPositive, UDFPower, UDFRand, UDFRegExp, UDFRegExpReplace, UDFRound, UDFRTrim, UDFSize, UDFSqrt, UDFSubstr, UDFToBoolean, UDFToByte, UDFToDate, UDFToDouble, UDFToFloat, UDFToInteger, UDFToLong, UDFToShort, UDFToString, UDFTrim, UDFUnixTimeStamp, UDFUpper, 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
protected UDF(UDFMethodResolver rslv)
          The constructor with user-provided UDFMethodResolver.
 
Method Summary
 UDFMethodResolver getResolver()
          Get the method resolver.
 void setResolver(UDFMethodResolver rslv)
          Sets the resolver
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UDF

public UDF()
The constructor


UDF

protected UDF(UDFMethodResolver rslv)
The constructor with user-provided UDFMethodResolver.

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.



Copyright © 2009 The Apache Software Foundation