@SuppressWarnings("unchecked")
@Override
public void visit( UserFuncExpression op ) throws FrontendException {
Object f = PigContext.instantiateFuncFromSpec(op.getFuncSpec());
PhysicalOperator p;
if (f instanceof EvalFunc) {
p = new POUserFunc(new OperatorKey(DEFAULT_SCOPE, nodeGen
.getNextNodeId(DEFAULT_SCOPE)), -1,
null, op.getFuncSpec(), (EvalFunc) f);
} else {
p = new POUserComparisonFunc(new OperatorKey(DEFAULT_SCOPE, nodeGen
.getNextNodeId(DEFAULT_SCOPE)), -1,
null, op.getFuncSpec(), (ComparisonFunc) f);
}
p.setResultType(op.getType());
currentPlan.add(p);
List<LogicalExpression> fromList = op.getArguments();
if(fromList!=null){
for (LogicalExpression inputOperator : fromList) {
PhysicalOperator from = logToPhyMap.get(inputOperator);
try {
currentPlan.connect(from, p);
} catch (PlanException e) {
int errCode = 2015;
String msg = "Invalid physical operators in the physical plan" ;