@Internal public class HiveSimpleUDF extends HiveScalarFunction<org.apache.hadoop.hive.ql.exec.UDF>
UDF
.argTypes, constantArguments, function, hiveFunctionWrapper, returnInspector
Constructor and Description |
---|
HiveSimpleUDF(HiveFunctionWrapper<org.apache.hadoop.hive.ql.exec.UDF> hiveFunctionWrapper) |
Modifier and Type | Method and Description |
---|---|
Object |
evalInternal(Object[] args)
Evaluation logical, args will be wrapped when is a single array.
|
DataType |
getHiveResultType(Object[] constantArguments,
DataType[] argTypes)
Get result type by arguments and argTypes.
|
void |
openInternal()
|
eval, getResultType, isDeterministic, open, setArgumentTypesAndConstants
getKind, getParameterTypes
close, functionIdentifier, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getRequirements
public HiveSimpleUDF(HiveFunctionWrapper<org.apache.hadoop.hive.ql.exec.UDF> hiveFunctionWrapper)
public void openInternal()
HiveScalarFunction
openInternal
in class HiveScalarFunction<org.apache.hadoop.hive.ql.exec.UDF>
public Object evalInternal(Object[] args)
HiveScalarFunction
evalInternal
in class HiveScalarFunction<org.apache.hadoop.hive.ql.exec.UDF>
public DataType getHiveResultType(Object[] constantArguments, DataType[] argTypes)
HiveFunction
We can't use getResultType(Object[], Class[]). The Class[] is the classes of what is defined in eval(), for example, if eval() is "public Integer eval(Double)", the argTypes would be Class[Double]. However, in our wrapper, the signature of eval() is "public Object eval(Object... args)", which means we cannot get any info from the interface.
constantArguments
- arguments of a function call (only literal arguments
are passed, nulls for non-literal ones)argTypes
- types of argumentsCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.