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())); } }
public void visit(AggregateSymbol obj) { preVisitVisitor(obj); Expression[] args = obj.getArgs(); if(args != null) { for(int i=0; i<args.length; i++) { visitNode(args[i]); } } visitNode(obj.getOrderBy()); visitNode(obj.getCondition()); postVisitVisitor(obj); } public void visit(AliasSymbol obj) {
public void visit(AggregateSymbol obj) { preVisitVisitor(obj); Expression[] args = obj.getArgs(); if(args != null) { for(int i=0; i<args.length; i++) { visitNode(args[i]); } } visitNode(obj.getOrderBy()); visitNode(obj.getCondition()); postVisitVisitor(obj); } public void visit(AliasSymbol obj) {
public void visit(AggregateSymbol obj) { preVisitVisitor(obj); Expression[] args = obj.getArgs(); if(args != null) { for(int i=0; i<args.length; i++) { visitNode(args[i]); } } visitNode(obj.getOrderBy()); visitNode(obj.getCondition()); postVisitVisitor(obj); } public void visit(AliasSymbol obj) {
private WindowFunctionInfo createWindowFunctionInfo(WindowFunction wf) { WindowFunctionInfo wfi = new WindowFunctionInfo(); wfi.function = wf; //collect the agg expressions for (Expression e : wf.getFunction().getArgs()) { GroupingNode.getIndex(e, expressionIndexes); } if (wf.getFunction().getOrderBy() != null) { for (OrderByItem item : wf.getFunction().getOrderBy().getOrderByItems()) { GroupingNode.getIndex(item.getSymbol(), expressionIndexes); } } if (wf.getFunction().getCondition() != null) { GroupingNode.getIndex(wf.getFunction().getCondition(), expressionIndexes); } return wfi; }
private WindowFunctionInfo createWindowFunctionInfo(WindowFunction wf) { WindowFunctionInfo wfi = new WindowFunctionInfo(); wfi.function = wf; //collect the agg expressions for (Expression e : wf.getFunction().getArgs()) { GroupingNode.getIndex(e, expressionIndexes); } if (wf.getFunction().getOrderBy() != null) { for (OrderByItem item : wf.getFunction().getOrderBy().getOrderByItems()) { GroupingNode.getIndex(item.getSymbol(), expressionIndexes); } } if (wf.getFunction().getCondition() != null) { GroupingNode.getIndex(wf.getFunction().getCondition(), expressionIndexes); } return wfi; }
if (wf.getFunction().getCondition() != null) { GroupingNode.getIndex(wf.getFunction().getCondition(), expressionIndexes);
AggregateFunction translate(AggregateSymbol symbol) { List<org.teiid.language.Expression> params = new ArrayList<org.teiid.language.Expression>(symbol.getArgs().length); for (Expression expression : symbol.getArgs()) { params.add(translate(expression)); } String name = symbol.getAggregateFunction().name(); if (symbol.getAggregateFunction() == AggregateSymbol.Type.USER_DEFINED) { name = symbol.getName(); } AggregateFunction af = new AggregateFunction(name, symbol.isDistinct(), params, symbol.getType()); af.setCondition(translate(symbol.getCondition())); af.setOrderBy(translate(symbol.getOrderBy(), false)); return af; }
if (args.length == 1 && expression.getCondition() != null && !expression.respectsNulls()) { Expression cond = expression.getCondition(); Expression ex = expression.getArg(0); if (!(cond instanceof Criteria)) {
if (args.length == 1 && expression.getCondition() != null && !expression.respectsNulls()) { Expression cond = expression.getCondition(); Expression ex = expression.getArg(0); if (!(cond instanceof Criteria)) {
if (args.length == 1 && expression.getCondition() != null && !expression.respectsNulls()) { Expression cond = expression.getCondition(); Expression ex = expression.getArg(0); if (!(cond instanceof Criteria)) {
AggregateFunction translate(AggregateSymbol symbol) { List<org.teiid.language.Expression> params = new ArrayList<org.teiid.language.Expression>(symbol.getArgs().length); for (Expression expression : symbol.getArgs()) { params.add(translate(expression)); } String name = symbol.getAggregateFunction().name(); if (symbol.getFunctionDescriptor() != null) { name = Symbol.getShortName(symbol.getFunctionDescriptor().getName()); } else if (symbol.getAggregateFunction() == AggregateSymbol.Type.USER_DEFINED) { name = symbol.getName(); } else if (symbol.getAggregateFunction() == Type.COUNT_BIG && !supportsCountBig) { name = Type.COUNT.name(); } AggregateFunction af = new AggregateFunction(name, symbol.isDistinct(), params, symbol.getType()); af.setCondition(translate(symbol.getCondition())); af.setOrderBy(translate(symbol.getOrderBy(), false)); if (symbol.getFunctionDescriptor() != null) { af.setMetadataObject(symbol.getFunctionDescriptor().getMethod()); } return af; }
AggregateFunction translate(AggregateSymbol symbol) { List<org.teiid.language.Expression> params = new ArrayList<org.teiid.language.Expression>(symbol.getArgs().length); for (Expression expression : symbol.getArgs()) { params.add(translate(expression)); } String name = symbol.getAggregateFunction().name(); if (symbol.getFunctionDescriptor() != null) { name = Symbol.getShortName(symbol.getFunctionDescriptor().getName()); } else if (symbol.getAggregateFunction() == AggregateSymbol.Type.USER_DEFINED) { name = symbol.getName(); } else if (symbol.getAggregateFunction() == Type.COUNT_BIG && !supportsCountBig) { name = Type.COUNT.name(); } AggregateFunction af = new AggregateFunction(name, symbol.isDistinct(), params, symbol.getType()); af.setCondition(translate(symbol.getCondition())); af.setOrderBy(translate(symbol.getOrderBy(), false)); if (symbol.getFunctionDescriptor() != null) { af.setMetadataObject(symbol.getFunctionDescriptor().getMethod()); } return af; }
if (distinct == null) { distinct = aggregateSymbol; } else if (!EquivalenceUtil.areEqual(distinct.getCondition(), aggregateSymbol.getCondition()) || !EquivalenceUtil.areEqual(distinct.getOrderBy(), aggregateSymbol.getOrderBy()) || !EquivalenceUtil.areEquivalent(distinct.getArgs(), aggregateSymbol.getArgs())) {
if (obj.getCondition() != null) { append(SPACE); append(FILTER); append(WHERE); append(SPACE); append(obj.getCondition()); append(Tokens.RPAREN);
if (obj.getCondition() != null) { append(SPACE); append(FILTER); append(WHERE); append(SPACE); append(obj.getCondition()); append(Tokens.RPAREN);
if (obj.getCondition() != null) { append(SPACE); append(FILTER); append(WHERE); append(SPACE); append(obj.getCondition()); append(Tokens.RPAREN);
handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.value_one_argument", windowFunction), windowFunction); //$NON-NLS-1$ if (windowFunction.getFunction().isDistinct() || windowFunction.getFunction().getCondition() != null) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.analytic_restriction", windowFunction), windowFunction); //$NON-NLS-1$ handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.value_three_arguments", windowFunction), windowFunction); //$NON-NLS-1$ if (windowFunction.getFunction().isDistinct() || windowFunction.getFunction().getCondition() != null) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.analytic_restriction", windowFunction), windowFunction); //$NON-NLS-1$