use of org.teiid.query.sql.lang.Query in project teiid by teiid.
the class TestOrderByRewrite method testOrderBy11.
@Test
public void testOrderBy11() throws Exception {
// $NON-NLS-1$
Query resolvedQuery = (Query) getCommand("SELECT a.e1, b.e1 FROM pm1.g1 AS a, pm1.g1 AS b ORDER BY b.e1");
helpCheckElements(resolvedQuery.getOrderBy(), // $NON-NLS-1$
new String[] { "b.e1" }, // $NON-NLS-1$
new String[] { "pm1.g1.e1" });
}
use of org.teiid.query.sql.lang.Query in project teiid by teiid.
the class TestOrderByRewrite method testOrderBy8.
@Test
public void testOrderBy8() throws Exception {
// $NON-NLS-1$
Query resolvedQuery = (Query) getCommand("SELECT x.e1 FROM pm1.g1 AS x ORDER BY e1");
helpCheckElements(resolvedQuery.getOrderBy(), // $NON-NLS-1$
new String[] { "x.e1" }, // $NON-NLS-1$
new String[] { "pm1.g1.e1" });
}
use of org.teiid.query.sql.lang.Query in project teiid by teiid.
the class TestOrderByRewrite method testOrderBy14.
@Test
public void testOrderBy14() throws Exception {
// $NON-NLS-1$
Query resolvedQuery = (Query) getCommand("SELECT a.e1 as x, pm1.g1.e1 as y FROM pm1.g1 AS a, pm1.g1 ORDER BY x");
helpCheckElements(resolvedQuery.getOrderBy(), // $NON-NLS-1$
new String[] { "a.e1" }, // $NON-NLS-1$
new String[] { "pm1.g1.e1" });
}
use of org.teiid.query.sql.lang.Query in project teiid by teiid.
the class TestOrderByRewrite method testOrderBy3.
@Test
public void testOrderBy3() throws Exception {
// $NON-NLS-1$
Query resolvedQuery = (Query) getCommand("SELECT * FROM pm1.g1 ORDER BY pm1.g1.e1");
helpCheckElements(resolvedQuery.getOrderBy(), // $NON-NLS-1$
new String[] { "pm1.g1.e1" }, // $NON-NLS-1$
new String[] { "pm1.g1.e1" });
}
use of org.teiid.query.sql.lang.Query in project teiid by teiid.
the class TestAccessNode method testShouldExecuteAgg.
@Test
public void testShouldExecuteAgg() throws Exception {
// $NON-NLS-1$
Query query = (Query) QueryParser.getQueryParser().parseCommand("SELECT count(*) FROM pm1.g1 where false");
assertTrue(RelationalNodeUtil.shouldExecute(query, false));
}
Aggregations