use of org.teiid.query.sql.symbol.AggregateSymbol in project teiid by teiid.
the class TestAggregateSymbol method testParser4.
public void testParser4() {
// $NON-NLS-1$
AggregateSymbol as = new AggregateSymbol(NonReserved.MAX, false, sampleFunction());
// $NON-NLS-1$
helpParser(as, "MAX((m.g.c + 5))");
}
use of org.teiid.query.sql.symbol.AggregateSymbol in project teiid by teiid.
the class TestAggregateSymbol method testEquals3.
// just changing the name of an aggregatesymbol doesn't matter
public void testEquals3() {
// $NON-NLS-1$
AggregateSymbol as1 = new AggregateSymbol(NonReserved.COUNT, true, sampleElement());
// $NON-NLS-1$
AggregateSymbol as2 = new AggregateSymbol(NonReserved.COUNT, true, sampleElement());
helpEquals(as1, as2, true);
}
use of org.teiid.query.sql.symbol.AggregateSymbol in project teiid by teiid.
the class ODataExpressionToSQLVisitor method visit.
@Override
public void visit(UriResourceNavigation info) {
try {
DocumentNode navigationResource = DocumentNode.build((EdmEntityType) info.getType(), info.getKeyPredicates(), this.metadata, this.odata, this.nameGenerator, true, getUriInfo(), this.parseService);
Query query = new Query();
query.setSelect(new Select(Arrays.asList(new AggregateSymbol(AggregateSymbol.Type.COUNT.name(), false, null))));
query.setFrom(new From(Arrays.asList(navigationResource.getFromClause())));
Criteria criteria = this.ctxQuery.buildJoinCriteria(navigationResource, info.getProperty());
if (criteria == null) {
throw new TeiidException(ODataPlugin.Event.TEIID16037, ODataPlugin.Util.gs(ODataPlugin.Event.TEIID16037));
}
query.setCriteria(criteria);
this.stack.add(new ScalarSubquery(query));
} catch (TeiidException e) {
throw new TeiidRuntimeException(e);
}
}
Aggregations