use of org.teiid.query.sql.lang.UnaryFromClause in project teiid by teiid.
the class TestLimitParsing method testFetchFirst.
@Test
public void testFetchFirst() {
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(2)));
// $NON-NLS-1$ //$NON-NLS-2$
helpTest("Select * from a fetch first 2 rows only", "SELECT * FROM a LIMIT 2", query);
}
use of org.teiid.query.sql.lang.UnaryFromClause in project teiid by teiid.
the class TestGroupCollectorVisitor method testUnaryFromClause.
public void testUnaryFromClause() {
GroupSymbol gs = exampleGroupSymbol(1);
UnaryFromClause ufc = new UnaryFromClause(gs);
Set groups = new HashSet();
groups.add(gs);
helpTestGroups(ufc, true, groups);
}
use of org.teiid.query.sql.lang.UnaryFromClause in project teiid by teiid.
the class TestGroupCollectorVisitor method testJoinPredicate1.
public void testJoinPredicate1() {
GroupSymbol gs1 = exampleGroupSymbol(1);
GroupSymbol gs2 = exampleGroupSymbol(2);
JoinPredicate jp = new JoinPredicate(new UnaryFromClause(gs1), new UnaryFromClause(gs2), JoinType.JOIN_CROSS);
Set groups = new HashSet();
groups.add(gs1);
groups.add(gs2);
helpTestGroups(jp, true, groups);
}
use of org.teiid.query.sql.lang.UnaryFromClause in project teiid by teiid.
the class TestGroupCollectorVisitor method testJoinPredicate2.
public void testJoinPredicate2() {
GroupSymbol gs1 = exampleGroupSymbol(1);
GroupSymbol gs2 = exampleGroupSymbol(2);
GroupSymbol gs3 = exampleGroupSymbol(3);
JoinPredicate jp1 = new JoinPredicate(new UnaryFromClause(gs1), new UnaryFromClause(gs2), JoinType.JOIN_CROSS);
JoinPredicate jp2 = new JoinPredicate(new UnaryFromClause(gs3), jp1, JoinType.JOIN_CROSS);
Set groups = new HashSet();
groups.add(gs1);
groups.add(gs2);
groups.add(gs3);
helpTestGroups(jp2, true, groups);
}
use of org.teiid.query.sql.lang.UnaryFromClause in project teiid by teiid.
the class TestAssignmentStatement method sample2.
public static final AssignmentStatement sample2() {
Query query = new Query();
// $NON-NLS-1$
query.setSelect(new Select(Arrays.asList(new ElementSymbol("x"))));
// $NON-NLS-1$
query.setFrom(new From(Arrays.asList(new UnaryFromClause(new GroupSymbol("y")))));
// $NON-NLS-1$
return new AssignmentStatement(new ElementSymbol("b"), query);
}
Aggregations