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

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

public class GenericUDFToDecimal
extends GenericUDF
implements SettableUDF


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.hive.ql.udf.generic.GenericUDF
GenericUDF.DeferredJavaObject, GenericUDF.DeferredObject
 
Constructor Summary
GenericUDFToDecimal()
           
 
Method Summary
 Object evaluate(GenericUDF.DeferredObject[] arguments)
          Evaluate the GenericUDF with the arguments.
 String getDisplayString(String[] children)
          Get the String to be displayed in explain.
 DecimalTypeInfo getTypeInfo()
           
 ObjectInspector initialize(ObjectInspector[] arguments)
          Initialize this GenericUDF.
 void setTypeInfo(DecimalTypeInfo typeInfo)
           
 void setTypeInfo(TypeInfo typeInfo)
          Add data to UDF prior to initialization.
 
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

GenericUDFToDecimal

public GenericUDFToDecimal()
Method Detail

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

getTypeInfo

public DecimalTypeInfo getTypeInfo()
Specified by:
getTypeInfo in interface SettableUDF

setTypeInfo

public void setTypeInfo(DecimalTypeInfo typeInfo)

setTypeInfo

public void setTypeInfo(TypeInfo typeInfo)
                 throws UDFArgumentException
Description copied from interface: SettableUDF
Add data to UDF prior to initialization. An exception may be thrown if the UDF doesn't know what to do with this data.

Specified by:
setTypeInfo in interface SettableUDF
Throws:
UDFArgumentException


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