Source:
public PythonUDFEvaluator( final Expression expression, final ExpressionOperatorParameter parameters) throws DbException { super(expression, parameters); pyFuncRegistrar = parameters.getPythonFunctionRegistrar(); if (pyFuncRegistrar == null) { throw new RuntimeException("PythonRegistrar should not be null in PythonUDFEvaluator."); } PyUDFExpression op = (PyUDFExpression) expression.getRootExpressionOperator(); outputType = op.getOutputType(parameters); List<ExpressionOperator> childops = op.getChildren(); columnIdxs = new int[childops.size()]; stateColumns = new HashSet<Integer>(); List<Type> types = new ArrayList<Type>(); for (int i = 0; i < childops.size(); i++) { if (childops.get(i) instanceof StateExpression) { stateColumns.add(i); columnIdxs[i] = ((StateExpression) childops.get(i)).getColumnIdx(); types.add(((StateExpression) childops.get(i)).getOutputType(parameters)); } else if (childops.get(i) instanceof VariableExpression) { columnIdxs[i] = ((VariableExpression) childops.get(i)).getColumnIdx(); types.add(((VariableExpression) childops.get(i)).getOutputType(parameters)); } else { throw new IllegalStateException( "Python expression can only have State or Variable expression as child expressions."); } } stateSchema = new Schema(types); String pyFunctionName = op.getName(); FunctionStatus fs = pyFuncRegistrar.getFunctionStatus(pyFunctionName); if (fs == null) { throw new DbException("No Python UDf with given name registered."); } isMultiValued = fs.getIsMultivalued(); pyWorker = new PythonWorker(); pyWorker.sendCodePickle(fs.getBinary(), columnIdxs.length, outputType, isMultiValued); buffer = new IntObjectHashMap<TupleBatchBuffer>(); }

Target:
public PythonUDFEvaluator( final Expression expression, final ExpressionOperatorParameter parameters) throws DbException { super(expression, parameters); pyFuncRegistrar = parameters.getPythonFunctionRegistrar(); if (pyFuncRegistrar == null) { throw new RuntimeException("PythonRegistrar should not be null in PythonUDFEvaluator."); } PyUDFExpression op = (PyUDFExpression) expression.getRootExpressionOperator(); outputType = op.getOutputType(parameters); List<ExpressionOperator> childops = op.getChildren(); columnIdxs = new int[childops.size()]; stateColumns = new HashSet<Integer>(); List<Type> types = new ArrayList<Type>(); for (int i = 0; i < childops.size(); i++) { if (childops.get(i) instanceof StateExpression) { stateColumns.add(i); columnIdxs[i] = ((StateExpression) childops.get(i)).getColumnIdx(); types.add(((StateExpression) childops.get(i)).getOutputType(parameters)); } else if (childops.get(i) instanceof VariableExpression) { columnIdxs[i] = ((VariableExpression) childops.get(i)).getColumnIdx(); types.add(((VariableExpression) childops.get(i)).getOutputType(parameters)); } else { throw new IllegalStateException( "Python expression can only have State or Variable expression as child expressions."); } } stateSchema = new Schema(types); String pyFunctionName = op.getName(); FunctionStatus fs = pyFuncRegistrar.getFunctionStatus(pyFunctionName); if (fs == null) { throw new DbException("No Python UDF with name " + pyFunctionName + " is registered."); } isMultiValued = fs.getIsMultiValued(); pyWorker = new PythonWorker(); pyWorker.sendCodePickle(fs.getBinary(), columnIdxs.length, outputType, isMultiValued); buffer = new TupleBuffer(stateSchema); }