public void visit(AggregateSymbol obj) { visit((Function)obj); if (obj.getCondition() != null) { obj.setCondition(replaceExpression(obj.getCondition())); } }
public void visit(AggregateSymbol obj) { visit((Function)obj); if (obj.getCondition() != null) { obj.setCondition(replaceExpression(obj.getCondition())); } }
public void visit(AggregateSymbol obj) { visit((Function)obj); if (obj.getCondition() != null) { obj.setCondition(replaceExpression(obj.getCondition())); } }
/** * Return a deep copy of this object */ public Object clone() { AggregateSymbol copy = new AggregateSymbol(getName(), getAggregateFunction(), isDistinct(), LanguageObject.Util.deepClone(getArgs())); if (orderBy != null) { copy.setOrderBy(orderBy.clone()); } if (condition != null) { copy.setCondition((Expression) condition.clone()); } copy.isWindowed = this.isWindowed; copy.type = this.type; copy.setFunctionDescriptor(getFunctionDescriptor()); return copy; }
/** * Return a deep copy of this object */ public Object clone() { AggregateSymbol copy = new AggregateSymbol(getName(), getAggregateFunction(), isDistinct(), LanguageObject.Util.deepClone(getArgs())); if (orderBy != null) { copy.setOrderBy(orderBy.clone()); } if (condition != null) { copy.setCondition((Expression) condition.clone()); } copy.isWindowed = this.isWindowed; copy.type = this.type; copy.setFunctionDescriptor(getFunctionDescriptor()); return copy; }
/** * Return a deep copy of this object */ public Object clone() { AggregateSymbol copy = new AggregateSymbol(getName(), getAggregateFunction(), isDistinct(), LanguageObject.Util.deepClone(getArgs())); if (orderBy != null) { copy.setOrderBy(orderBy.clone()); } if (condition != null) { copy.setCondition((Expression) condition.clone()); } copy.isWindowed = this.isWindowed; copy.type = this.type; copy.setFunctionDescriptor(getFunctionDescriptor()); return copy; }
@Test public void testAggFilter() throws Exception { String sql = "select count(*) filter (where x = 1) from g"; Query query = new Query(); AggregateSymbol aggregateSymbol = new AggregateSymbol(AggregateSymbol.Type.COUNT.name(), false, null); aggregateSymbol.setCondition(new CompareCriteria(new ElementSymbol("x"), CompareCriteria.EQ, new Constant(1))); query.setSelect(new Select(Arrays.asList(aggregateSymbol))); query.setFrom(new From(Arrays.asList(new UnaryFromClause(new GroupSymbol("g"))))); helpTest(sql, "SELECT COUNT(*) FILTER(WHERE x = 1) FROM g", query); }
@Test public void testAggFilterCountBig() throws Exception { String sql = "select count_big(*) filter (where x = 1) from g"; Query query = new Query(); AggregateSymbol aggregateSymbol = new AggregateSymbol(AggregateSymbol.Type.COUNT_BIG.name(), false, null); aggregateSymbol.setCondition(new CompareCriteria(new ElementSymbol("x"), CompareCriteria.EQ, new Constant(1))); query.setSelect(new Select(Arrays.asList(aggregateSymbol))); query.setFrom(new From(Arrays.asList(new UnaryFromClause(new GroupSymbol("g"))))); helpTest(sql, "SELECT COUNT_BIG(*) FILTER(WHERE x = 1) FROM g", query); }
expression.setCondition(null); expression.setArgs(new Expression[] {sce}); args = expression.getArgs();
expression.setCondition(null); expression.setArgs(new Expression[] {sce}); args = expression.getArgs();
expression.setCondition(null); expression.setArgs(new Expression[] {sce}); args = expression.getArgs();
((WindowFunction)expression).getFunction().setCondition(condition); } else { ((AggregateSymbol)expression).setCondition(condition);
((WindowFunction)expression).getFunction().setCondition(condition); } else { ((AggregateSymbol)expression).setCondition(condition);
((WindowFunction)expression).getFunction().setCondition(condition); } else { ((AggregateSymbol)expression).setCondition(condition);
as.setCondition(condition); {if (true) return as;}
as.setCondition(condition); {if (true) return as;}
as.setCondition(condition); {if (true) return as;}
if (obj.getCondition() != null) { try { obj.setCondition(ResolverUtil.convertExpression(obj.getCondition(), DataTypeManager.DefaultDataTypes.BOOLEAN, metadata)); } catch (QueryResolverException e) { handleException(e);
if (obj.getCondition() != null) { try { obj.setCondition(ResolverUtil.convertExpression(obj.getCondition(), DataTypeManager.DefaultDataTypes.BOOLEAN, metadata)); } catch (QueryResolverException e) { handleException(e);
if (obj.getCondition() != null) { try { obj.setCondition(ResolverUtil.convertExpression(obj.getCondition(), DataTypeManager.DefaultDataTypes.BOOLEAN, metadata)); } catch (QueryResolverException e) { handleException(e);