Class HiveFuncHolder

java.lang.Object
org.apache.drill.exec.expr.fn.AbstractFuncHolder
org.apache.drill.exec.expr.fn.HiveFuncHolder
All Implemented Interfaces:
FuncHolder

public class HiveFuncHolder extends AbstractFuncHolder
  • 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 class
      argTypes -
      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 class
      udfClazz - UDF implementation class
      argTypes -
      returnOI -
      returnType -
  • Method Details

    • getReturnType

      public TypeProtos.MajorType getReturnType()
      UDF return type
    • isAggregating

      public boolean isAggregating()
      Aggregate function
    • isRandom

      public boolean isRandom()
      is the function non-deterministic?
    • getParamMajorType

      public TypeProtos.MajorType getParamMajorType(int i)
      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 class AbstractFuncHolder
      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 class AbstractFuncHolder
      Parameters:
      classGenerator - the class responsible for code generation
      inputVariables - the source of the vector holders
      workspaceJVars - class fields
      holderExpr - holder for the function expression
      Returns:
      HoldingContainer for return value
    • getExpr

      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 call
      args - expressions of the actual function arguments
      Returns:
      an expression that holds the function definition (this object), actual parameters and related information