/** * Add expression to the expression manager, returning the same one if * already used. */ protected Expression addExpression(Expression expression) { return context.getExpressionManager().addIfAbsent(expression); }
protected CountAggregateFunction getDelegateFunction(List<Expression> children, StatementContext context) { CountAggregateFunction countFunc = null; if (getChildren().get(0).isStateless()) { countFunc = (CountAggregateFunction)context.getExpressionManager().addIfAbsent(new CountAggregateFunction(children)); } return countFunc; }
@Override public FunctionExpression create(List<Expression> children, StatementContext context) throws SQLException { SumAggregateFunction sumFunc; CountAggregateFunction countFunc = (CountAggregateFunction)context.getExpressionManager().addIfAbsent(new CountAggregateFunction(children)); if (!countFunc.isConstantExpression()) { sumFunc = (SumAggregateFunction)context.getExpressionManager().addIfAbsent(new SumAggregateFunction(countFunc.getChildren(),null)); } else { sumFunc = null; } return new AvgAggregateFunction(children, countFunc, sumFunc); } }
final Set<SingleAggregateFunction> aggFuncSet = Sets.newHashSetWithExpectedSize(context.getExpressionManager().getExpressionCount()); Iterator<Expression> expressions = context.getExpressionManager().getExpressions(); while (expressions.hasNext()) { Expression expression = expressions.next();
/** * Add expression to the expression manager, returning the same one if * already used. */ protected Expression addExpression(Expression expression) { return context.getExpressionManager().addIfAbsent(expression); }
/** * Add expression to the expression manager, returning the same one if * already used. */ protected Expression addExpression(Expression expression) { return context.getExpressionManager().addIfAbsent(expression); }
protected CountAggregateFunction getDelegateFunction(List<Expression> children, StatementContext context) { CountAggregateFunction countFunc = null; if (getChildren().get(0).isStateless()) { countFunc = (CountAggregateFunction)context.getExpressionManager().addIfAbsent(new CountAggregateFunction(children)); } return countFunc; }
protected CountAggregateFunction getDelegateFunction(List<Expression> children, StatementContext context) { CountAggregateFunction countFunc = null; if (getChildren().get(0).isStateless()) { countFunc = (CountAggregateFunction)context.getExpressionManager().addIfAbsent(new CountAggregateFunction(children)); } return countFunc; }
@Override public FunctionExpression create(List<Expression> children, StatementContext context) throws SQLException { SumAggregateFunction sumFunc; CountAggregateFunction countFunc = (CountAggregateFunction)context.getExpressionManager().addIfAbsent(new CountAggregateFunction(children)); if (!countFunc.isConstantExpression()) { sumFunc = (SumAggregateFunction)context.getExpressionManager().addIfAbsent(new SumAggregateFunction(countFunc.getChildren(),null)); } else { sumFunc = null; } return new AvgAggregateFunction(children, countFunc, sumFunc); } }
@Override public FunctionExpression create(List<Expression> children, StatementContext context) throws SQLException { SumAggregateFunction sumFunc; CountAggregateFunction countFunc = (CountAggregateFunction)context.getExpressionManager().addIfAbsent(new CountAggregateFunction(children)); if (!countFunc.isConstantExpression()) { sumFunc = (SumAggregateFunction)context.getExpressionManager().addIfAbsent(new SumAggregateFunction(countFunc.getChildren(),null)); } else { sumFunc = null; } return new AvgAggregateFunction(children, countFunc, sumFunc); } }
final Set<SingleAggregateFunction> aggFuncSet = Sets.newHashSetWithExpectedSize(context.getExpressionManager().getExpressionCount()); Iterator<Expression> expressions = context.getExpressionManager().getExpressions(); while (expressions.hasNext()) { Expression expression = expressions.next();
final Set<SingleAggregateFunction> aggFuncSet = Sets.newHashSetWithExpectedSize(context.getExpressionManager().getExpressionCount()); Iterator<Expression> expressions = context.getExpressionManager().getExpressions(); while (expressions.hasNext()) { Expression expression = expressions.next();