use of org.teiid.query.sql.symbol.Constant in project teiid by teiid.
the class TestArrayProcessing method testArrayEquivalence.
@Test
public void testArrayEquivalence() throws Exception {
Array a1 = new Array(new ArrayList<Expression>());
UnitTestUtil.helpTestEquivalence(0, a1, a1);
Array a2 = new Array(Arrays.asList((Expression) new Constant(1)));
UnitTestUtil.helpTestEquivalence(1, a1, a2);
}
use of org.teiid.query.sql.symbol.Constant in project teiid by teiid.
the class TestRuleValidateWhereAll method testHasNoCriteria2.
public void testHasNoCriteria2() {
Query query = new Query();
// $NON-NLS-1$ //$NON-NLS-2$
CompareCriteria crit = new CompareCriteria(new Constant("a"), CompareCriteria.EQ, new Constant("b"));
query.setCriteria(crit);
// $NON-NLS-1$
assertEquals("Got incorrect answer checking for no criteria", false, RuleValidateWhereAll.hasNoCriteria(query));
}
use of org.teiid.query.sql.symbol.Constant in project teiid by teiid.
the class TestLimitParsing method testLimitWithOffset.
@Test
public void testLimitWithOffset() {
Query query = new Query();
Select select = new Select(Arrays.asList(new MultipleElementSymbol()));
// $NON-NLS-1$
From from = new From(Arrays.asList(new UnaryFromClause(new GroupSymbol("a"))));
query.setSelect(select);
query.setFrom(from);
query.setLimit(new Limit(new Constant(new Integer(50)), new Constant(new Integer(100))));
// $NON-NLS-1$ //$NON-NLS-2$
helpTest("Select * from a limit 50,100", "SELECT * FROM a LIMIT 50, 100", query);
}
use of org.teiid.query.sql.symbol.Constant in project teiid by teiid.
the class TestLimitParsing method testLimitWithReferences2.
@Test
public void testLimitWithReferences2() {
Query query = new Query();
Select select = new Select(Arrays.asList(new MultipleElementSymbol()));
// $NON-NLS-1$
From from = new From(Arrays.asList(new UnaryFromClause(new GroupSymbol("a"))));
query.setSelect(select);
query.setFrom(from);
query.setLimit(new Limit(new Constant(new Integer(50)), new Reference(0)));
// $NON-NLS-1$ //$NON-NLS-2$
helpTest("Select * from a limit 50,?", "SELECT * FROM a LIMIT 50, ?", query);
}
use of org.teiid.query.sql.symbol.Constant in project teiid by teiid.
the class TestLimitParsing method testFetchFirstRow.
@Test
public void testFetchFirstRow() {
Query query = new Query();
Select select = new Select(Arrays.asList(new MultipleElementSymbol()));
// $NON-NLS-1$
From from = new From(Arrays.asList(new UnaryFromClause(new GroupSymbol("a"))));
query.setSelect(select);
query.setFrom(from);
query.setLimit(new Limit(null, new Constant(1)));
// $NON-NLS-1$ //$NON-NLS-2$
helpTest("Select * from a fetch first row only", "SELECT * FROM a LIMIT 1", query);
}
Aggregations