Ejemplo n.º 1
0
 protected void initialize(PTFExpressionDef eDef, ShapeDetails inpShape) throws HiveException {
   ExprNodeDesc exprNode = eDef.getExprNode();
   ExprNodeEvaluator exprEval = WindowingExprNodeEvaluatorFactory.get(llInfo, exprNode);
   ObjectInspector oi = initExprNodeEvaluator(exprEval, exprNode, inpShape);
   eDef.setExprEvaluator(exprEval);
   eDef.setOI(oi);
 }
Ejemplo n.º 2
0
  static void setupWdwFnEvaluator(WindowFunctionDef def) throws HiveException {
    ArrayList<PTFExpressionDef> args = def.getArgs();
    ArrayList<ObjectInspector> argOIs = new ArrayList<ObjectInspector>();
    ObjectInspector[] funcArgOIs = null;

    if (args != null) {
      for (PTFExpressionDef arg : args) {
        argOIs.add(arg.getOI());
      }
      funcArgOIs = new ObjectInspector[args.size()];
      funcArgOIs = argOIs.toArray(funcArgOIs);
    }

    GenericUDAFEvaluator wFnEval = def.getWFnEval();
    ObjectInspector OI = wFnEval.init(GenericUDAFEvaluator.Mode.COMPLETE, funcArgOIs);
    def.setWFnEval(wFnEval);
    def.setOI(OI);
  }