query.setSelect(innerSelect);
Query outerQuery = null;
try {
outerQuery = QueryRewriter.createInlineViewQuery(new GroupSymbol("X"), query, metadata, query.getSelect().getProjectedSymbols()); //$NON-NLS-1$
} catch (TeiidException err) {
throw new TeiidRuntimeException(err);
}
Iterator<SingleElementSymbol> iter = outerQuery.getSelect().getProjectedSymbols().iterator();
HashMap<Expression, SingleElementSymbol> expressionMap = new HashMap<Expression, SingleElementSymbol>();
for (SingleElementSymbol symbol : query.getSelect().getProjectedSymbols()) {
expressionMap.put(SymbolMap.getExpression(symbol), iter.next());