public static LogicalExpression createBooleanOperator(String functionName, ExpressionPosition ep, List<LogicalExpression> args){ return new BooleanOperator(replaceOpWithFuncName(functionName), args, ep); }
@Override public LogicalExpression visitBooleanOperator(BooleanOperator op, Void value) throws RuntimeException { List<LogicalExpression> newArgs = Lists.newArrayList(); newArgs.addAll(op.args); Collections.sort(newArgs, costComparator); return new BooleanOperator(op.getName(), newArgs, op.getPosition()); }
public static LogicalExpression createExpression(String functionName, ExpressionPosition ep, List<LogicalExpression> args){ String name = replaceOpWithFuncName(functionName); if (isBooleanOperator(name)) { return new BooleanOperator(name, args, ep); } else { return new FunctionCall(name, args, ep); } }
public static LogicalExpression createBooleanOperator(String functionName, ExpressionPosition ep, List<LogicalExpression> args){ return new BooleanOperator(replaceOpWithFuncName(functionName), args, ep); }
@Override public LogicalExpression visitBooleanOperator(BooleanOperator op, Void value) throws RuntimeException { List<LogicalExpression> newArgs = Lists.newArrayList(); newArgs.addAll(op.args); Collections.sort(newArgs, costComparator); return new BooleanOperator(op.getName(), newArgs, op.getPosition()); }
public static LogicalExpression createExpression(String functionName, ExpressionPosition ep, List<LogicalExpression> args){ String name = replaceOpWithFuncName(functionName); if (isBooleanOperator(name)) { return new BooleanOperator(name, args, ep); } else { return new FunctionCall(name, args, ep); } }
@Override public LogicalExpression visitBooleanOperator(BooleanOperator op, FunctionLookupContext functionLookupContext) { List<LogicalExpression> args = Lists.newArrayList(); for (int i = 0; i < op.args.size(); ++i) { LogicalExpression newExpr = op.args.get(i).accept(this, functionLookupContext); assert newExpr != null : String.format("Materialization of %s return a null expression.", op.args.get(i)); args.add(newExpr); } //replace with a new function call, since its argument could be changed. return new BooleanOperator(op.getName(), args, op.getPosition()); }