/** * If the element has alias wrapping, then return the matching alias element. * @return matched alias symbol; null otherwise. */ private AliasSymbol getMachingAlias(List<Expression> elementsInGroup, ElementSymbol symbol) { for (Expression element : elementsInGroup) { if (element instanceof AliasSymbol) { AliasSymbol alias = (AliasSymbol)element; if (alias.getSymbol().equals(symbol)) { return alias; } } } return null; }
public static final Expression getExpression(Expression symbol) { if (symbol instanceof AliasSymbol) { symbol = ((AliasSymbol)symbol).getSymbol(); } if (symbol instanceof ExpressionSymbol) { ExpressionSymbol exprSymbol = (ExpressionSymbol)symbol; return exprSymbol.getExpression(); } return symbol; }
public static final Expression getExpression(Expression symbol) { if (symbol instanceof AliasSymbol) { symbol = ((AliasSymbol)symbol).getSymbol(); } if (symbol instanceof ExpressionSymbol) { ExpressionSymbol exprSymbol = (ExpressionSymbol)symbol; return exprSymbol.getExpression(); } return symbol; }
public static final Expression getExpression(Expression symbol) { if (symbol instanceof AliasSymbol) { symbol = ((AliasSymbol)symbol).getSymbol(); } if (symbol instanceof ExpressionSymbol) { ExpressionSymbol exprSymbol = (ExpressionSymbol)symbol; return exprSymbol.getExpression(); } return symbol; }
org.teiid.language.Expression translate(AliasSymbol symbol) { return translate(symbol.getSymbol()); }
org.teiid.language.Expression translate(AliasSymbol symbol) { return translate(symbol.getSymbol()); }
org.teiid.language.Expression translate(AliasSymbol symbol) { return translate(symbol.getSymbol()); }
/** * @see org.teiid.query.sql.LanguageVisitor#visit(org.teiid.query.sql.symbol.AliasSymbol) */ public void visit(AliasSymbol obj) { Expression replacement = replaceExpression(obj.getSymbol()); obj.setSymbol(replacement); }
/** * @see org.teiid.query.sql.LanguageVisitor#visit(org.teiid.query.sql.symbol.AliasSymbol) */ public void visit(AliasSymbol obj) { Expression replacement = replaceExpression(obj.getSymbol()); obj.setSymbol(replacement); }
/** * @see org.teiid.query.sql.LanguageVisitor#visit(org.teiid.query.sql.symbol.AliasSymbol) */ public void visit(AliasSymbol obj) { Expression replacement = replaceExpression(obj.getSymbol()); obj.setSymbol(replacement); }
public void visit(AliasSymbol obj) { preVisitVisitor(obj); visitNode(obj.getSymbol()); postVisitVisitor(obj); } public void visit(MultipleElementSymbol obj) {
public void visit(AliasSymbol obj) { preVisitVisitor(obj); visitNode(obj.getSymbol()); postVisitVisitor(obj); } public void visit(MultipleElementSymbol obj) {
public void visit(AliasSymbol obj) { preVisitVisitor(obj); visitNode(obj.getSymbol()); postVisitVisitor(obj); } public void visit(MultipleElementSymbol obj) {
public Query selectQuery() throws TeiidException { if (!this.exceptions.isEmpty()) { throw this.exceptions.get(0); } Query query = this.context.buildQuery(); if (this.countQuery) { AggregateSymbol aggregateSymbol = new AggregateSymbol(AggregateSymbol.Type.COUNT.name(), false, null); Select select = new Select(Arrays.asList(aggregateSymbol)); query.setSelect(select); } else if (this.orderBy != null) { if (this.context.getIterator() != null) { //currently this doesn't matter as the ordering can only be based upon the parent entity ((AggregateSymbol)((AliasSymbol)query.getSelect().getSymbol(query.getSelect().getProjectedSymbols().size() - 1)).getSymbol()).setOrderBy(this.orderBy); } else { query.setOrderBy(this.orderBy); } } if (this.expandOption != null) { processExpandOption(this.expandOption, this.context, query, 1, null); } return query; }
@Override public void visit( AliasSymbol obj ) { visitNode(obj.getSymbol()); append(SPACE); append(AS); append(SPACE); append(escapeSinglePart(obj.getOutputName())); }
@Override public void visit( AliasSymbol obj ) { visitNode(obj.getSymbol()); append(SPACE); append(AS); append(SPACE); append(escapeSinglePart(obj.getOutputName())); }
@Override public void visit( AliasSymbol obj ) { visitNode(obj.getSymbol()); append(SPACE); append(AS); append(SPACE); append(escapeSinglePart(obj.getOutputName())); }
private static void rewriteSingleElementSymbol( QueryMetadataInterface metadata, Expression ses) throws QueryPlannerException { try { if (ses instanceof AliasSymbol) { ses = ((AliasSymbol)ses).getSymbol(); } if (ses instanceof ExpressionSymbol) { ExpressionSymbol es = (ExpressionSymbol)ses; if (es.getExpression() != null) { es.setExpression(QueryRewriter.rewriteExpression(es.getExpression(), null, metadata)); } } } catch(TeiidProcessingException e) { throw new QueryPlannerException(QueryPlugin.Event.TEIID30263, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30263, ses)); } catch (TeiidComponentException e) { throw new QueryPlannerException(QueryPlugin.Event.TEIID30263, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30263, ses)); } }
private static void rewriteSingleElementSymbol( QueryMetadataInterface metadata, Expression ses) throws QueryPlannerException { try { if (ses instanceof AliasSymbol) { ses = ((AliasSymbol)ses).getSymbol(); } if (ses instanceof ExpressionSymbol) { ExpressionSymbol es = (ExpressionSymbol)ses; if (es.getExpression() != null) { es.setExpression(QueryRewriter.rewriteExpression(es.getExpression(), null, metadata)); } } } catch(TeiidProcessingException e) { throw new QueryPlannerException(QueryPlugin.Event.TEIID30263, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30263, ses)); } catch (TeiidComponentException e) { throw new QueryPlannerException(QueryPlugin.Event.TEIID30263, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30263, ses)); } }
private static void rewriteSingleElementSymbol( QueryMetadataInterface metadata, Expression ses) throws QueryPlannerException { try { if (ses instanceof AliasSymbol) { ses = ((AliasSymbol)ses).getSymbol(); } if (ses instanceof ExpressionSymbol) { ExpressionSymbol es = (ExpressionSymbol)ses; if (es.getExpression() != null) { es.setExpression(QueryRewriter.rewriteExpression(es.getExpression(), null, metadata)); } } } catch(TeiidProcessingException e) { throw new QueryPlannerException(QueryPlugin.Event.TEIID30263, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30263, ses)); } catch (TeiidComponentException e) { throw new QueryPlannerException(QueryPlugin.Event.TEIID30263, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30263, ses)); } }