public class GenericUDFRound extends GenericUDF
GenericUDF.DeferredJavaObject, GenericUDF.DeferredObject
Constructor and Description |
---|
GenericUDFRound() |
Modifier and Type | Method and Description |
---|---|
Object |
evaluate(GenericUDF.DeferredObject[] arguments)
Evaluate the GenericUDF with the arguments.
|
String |
getDisplayString(String[] children)
Get the String to be displayed in explain.
|
ObjectInspector |
initialize(ObjectInspector[] arguments)
Initialize this GenericUDF.
|
protected double |
round(double input,
int scale) |
protected DoubleWritable |
round(DoubleWritable input,
int scale) |
protected org.apache.hadoop.hive.serde2.io.HiveDecimalWritable |
round(org.apache.hadoop.hive.serde2.io.HiveDecimalWritable inputDecWritable,
int scale) |
protected long |
round(long input,
int scale) |
checkArgGroups, checkArgPrimitive, checkArgsSize, close, configure, copyToNewInstance, flip, getArgOrder, getConstantBooleanValue, getConstantIntValue, getConstantStringValue, getDateValue, getDoubleValue, getFuncName, getIntervalDayTimeValue, getIntervalYearMonthValue, getIntValue, getLongValue, getRequiredFiles, getRequiredJars, getStandardDisplayString, getStandardDisplayString, getStringValue, getTimestampValue, getUdfName, initializeAndFoldConstants, negative, obtainDateConverter, obtainDoubleConverter, obtainIntConverter, obtainLongConverter, obtainStringConverter, obtainTimestampConverter
public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException
GenericUDF
initialize
in class GenericUDF
arguments
- The ObjectInspector for the argumentsUDFArgumentException
- Thrown when arguments have wrong types, wrong length, etc.public Object evaluate(GenericUDF.DeferredObject[] arguments) throws HiveException
GenericUDF
evaluate
in class GenericUDF
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.HiveException
protected org.apache.hadoop.hive.serde2.io.HiveDecimalWritable round(org.apache.hadoop.hive.serde2.io.HiveDecimalWritable inputDecWritable, int scale)
protected long round(long input, int scale)
protected double round(double input, int scale)
protected DoubleWritable round(DoubleWritable input, int scale)
public String getDisplayString(String[] children)
GenericUDF
getDisplayString
in class GenericUDF
Copyright © 2022 The Apache Software Foundation. All rights reserved.