{
OI = exprEval.initialize(iInfo.getOI());
}
catch (HiveException he)
{
throw new WindowingException(he);
}
/*
* if there are any LeadLag functions in this Expression Tree: - setup a
* duplicate Evaluator for the 1st arg of the LLFuncDesc - initialize it
* using the InputInfo provided for this Expr tree - set the duplicate
* evaluator on the LLUDF instance.
*/
LeadLagInfo llInfo = qDef.getTranslationInfo().getLLInfo();
List<ExprNodeGenericFuncDesc> llFuncExprs = llInfo
.getLLFuncExprsInTopExpr(exprNode);
if (llFuncExprs != null)
{
for (ExprNodeGenericFuncDesc llFuncExpr : llFuncExprs)
{
ExprNodeDesc firstArg = llFuncExpr.getChildren().get(0);
ExprNodeEvaluator dupExprEval = WindowingExprNodeEvaluatorFactory
.get(qDef.getTranslationInfo(), firstArg);
try
{
dupExprEval.initialize(iInfo.getOI());
}
catch (HiveException he)
{
throw new WindowingException(he);
}
GenericUDFLeadLag llFn = (GenericUDFLeadLag) llFuncExpr
.getGenericUDF();
llFn.setExprEvaluator(dupExprEval);
}