org.apache.hadoop.hive.ql.udf.generic
Class GenericUDFMacro

java.lang.Object
  extended by org.apache.hadoop.hive.ql.udf.generic.GenericUDF
      extended by org.apache.hadoop.hive.ql.udf.generic.GenericUDFMacro
All Implemented Interfaces:
Closeable, Serializable

public class GenericUDFMacro
extends GenericUDF
implements Serializable

GenericUDFMacro wraps a user-defined macro expression into a GenericUDF interface.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.hive.ql.udf.generic.GenericUDF
GenericUDF.DeferredJavaObject, GenericUDF.DeferredObject
 
Constructor Summary
GenericUDFMacro()
           
GenericUDFMacro(String macroName, ExprNodeDesc bodyDesc, List<String> colNames, List<TypeInfo> colTypes)
           
 
Method Summary
 Object evaluate(GenericUDF.DeferredObject[] arguments)
          Evaluate the GenericUDF with the arguments.
 ExprNodeDesc getBody()
           
 List<String> getColNames()
           
 List<TypeInfo> getColTypes()
           
 String getDisplayString(String[] children)
          Get the String to be displayed in explain.
 String getMacroName()
           
 ObjectInspector initialize(ObjectInspector[] arguments)
          Initialize this GenericUDF.
 boolean isDeterministic()
           
 boolean isStateful()
           
 void setBody(ExprNodeDesc bodyDesc)
           
 void setColNames(List<String> colNames)
           
 void setColTypes(List<TypeInfo> colTypes)
           
 void setMacroName(String macroName)
           
 
Methods inherited from class org.apache.hadoop.hive.ql.udf.generic.GenericUDF
close, configure, copyToNewInstance, flip, getRequiredFiles, getRequiredJars, getUdfName, initializeAndFoldConstants
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericUDFMacro

public GenericUDFMacro(String macroName,
                       ExprNodeDesc bodyDesc,
                       List<String> colNames,
                       List<TypeInfo> colTypes)

GenericUDFMacro

public GenericUDFMacro()
Method Detail

isDeterministic

public boolean isDeterministic()

isStateful

public boolean isStateful()

initialize

public ObjectInspector initialize(ObjectInspector[] arguments)
                           throws UDFArgumentException
Description copied from class: GenericUDF
Initialize this GenericUDF. This will be called once and only once per GenericUDF instance.

Specified by:
initialize in class GenericUDF
Parameters:
arguments - The ObjectInspector for the arguments
Returns:
The ObjectInspector for the return value
Throws:
UDFArgumentException - Thrown when arguments have wrong types, wrong length, etc.

evaluate

public Object evaluate(GenericUDF.DeferredObject[] arguments)
                throws HiveException
Description copied from class: GenericUDF
Evaluate the GenericUDF with the arguments.

Specified by:
evaluate in class GenericUDF
Parameters:
arguments - The arguments as DeferedObject, use DeferedObject.get() to get the actual argument Object. The Objects can be inspected by the ObjectInspectors passed in the initialize call.
Returns:
The
Throws:
HiveException

getDisplayString

public String getDisplayString(String[] children)
Description copied from class: GenericUDF
Get the String to be displayed in explain.

Specified by:
getDisplayString in class GenericUDF

setMacroName

public void setMacroName(String macroName)

getMacroName

public String getMacroName()

setBody

public void setBody(ExprNodeDesc bodyDesc)

getBody

public ExprNodeDesc getBody()

setColNames

public void setColNames(List<String> colNames)

getColNames

public List<String> getColNames()

setColTypes

public void setColTypes(List<TypeInfo> colTypes)

getColTypes

public List<TypeInfo> getColTypes()


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