Package org.apache.drill.exec.expr.fn
Class HiveFuncHolder
java.lang.Object
org.apache.drill.exec.expr.fn.AbstractFuncHolder
org.apache.drill.exec.expr.fn.HiveFuncHolder
- All Implemented Interfaces:
FuncHolder
-
Constructor Summary
ConstructorDescriptionHiveFuncHolder
(Class<? extends org.apache.hadoop.hive.ql.udf.generic.GenericUDF> genericUdfClazz, TypeProtos.MajorType[] argTypes, org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector returnOI, TypeProtos.MajorType returnType, boolean isRandom) Create holder for GenericUDFHiveFuncHolder
(String udfName, Class<? extends org.apache.hadoop.hive.ql.exec.UDF> udfClazz, TypeProtos.MajorType[] argTypes, org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector returnOI, TypeProtos.MajorType returnType, boolean isRandom) Create holder for UDF -
Method Summary
Modifier and TypeMethodDescriptiongetExpr
(String name, List<LogicalExpression> args, ExpressionPosition pos) Return a reference to this function given a function alias and a list of actual arguments.int
Number of defined input parameters.getParamMajorType
(int i) Drill SQL type of an input parameter.UDF return typeboolean
Aggregate functionboolean
isRandom()
is the function non-deterministic?renderEnd
(ClassGenerator<?> classGenerator, ClassGenerator.HoldingContainer[] inputVariables, com.sun.codemodel.JVar[] workspaceJVars, FunctionHolderExpression holderExpr) Generate methods body and complete the code generation.com.sun.codemodel.JVar[]
renderStart
(ClassGenerator<?> g, ClassGenerator.HoldingContainer[] inputVariables, FieldReference fieldReference) Start generating codeMethods inherited from class org.apache.drill.exec.expr.fn.AbstractFuncHolder
isComplexWriterFuncHolder, isNested, renderMiddle
-
Constructor Details
-
HiveFuncHolder
public HiveFuncHolder(Class<? extends org.apache.hadoop.hive.ql.udf.generic.GenericUDF> genericUdfClazz, TypeProtos.MajorType[] argTypes, org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector returnOI, TypeProtos.MajorType returnType, boolean isRandom) Create holder for GenericUDF- Parameters:
genericUdfClazz
- implementation classargTypes
-returnOI
-returnType
-
-
HiveFuncHolder
public HiveFuncHolder(String udfName, Class<? extends org.apache.hadoop.hive.ql.exec.UDF> udfClazz, TypeProtos.MajorType[] argTypes, org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector returnOI, TypeProtos.MajorType returnType, boolean isRandom) Create holder for UDF- Parameters:
udfName
- name of the UDF classudfClazz
- UDF implementation classargTypes
-returnOI
-returnType
-
-
-
Method Details
-
getReturnType
UDF return type -
isAggregating
public boolean isAggregating()Aggregate function -
isRandom
public boolean isRandom()is the function non-deterministic? -
getParamMajorType
Description copied from interface:FuncHolder
Drill SQL type of an input parameter. -
getParamCount
public int getParamCount()Description copied from interface:FuncHolder
Number of defined input parameters. -
renderStart
public com.sun.codemodel.JVar[] renderStart(ClassGenerator<?> g, ClassGenerator.HoldingContainer[] inputVariables, FieldReference fieldReference) Start generating code- Specified by:
renderStart
in classAbstractFuncHolder
- Returns:
- workspace variables
-
renderEnd
public ClassGenerator.HoldingContainer renderEnd(ClassGenerator<?> classGenerator, ClassGenerator.HoldingContainer[] inputVariables, com.sun.codemodel.JVar[] workspaceJVars, FunctionHolderExpression holderExpr) Description copied from class:AbstractFuncHolder
Generate methods body and complete the code generation.- Specified by:
renderEnd
in classAbstractFuncHolder
- Parameters:
classGenerator
- the class responsible for code generationinputVariables
- the source of the vector holdersworkspaceJVars
- class fieldsholderExpr
- holder for the function expression- Returns:
- HoldingContainer for return value
-
getExpr
public FunctionHolderExpression getExpr(String name, List<LogicalExpression> args, ExpressionPosition pos) Description copied from interface:FuncHolder
Return a reference to this function given a function alias and a list of actual arguments.- Parameters:
name
- alias used in this specific callargs
- expressions of the actual function arguments- Returns:
- an expression that holds the function definition (this object), actual parameters and related information
-