use of org.teiid.query.sql.symbol.MultipleElementSymbol in project teiid by teiid.
the class TestOptionsAndHints method testOptionalFromClause3.
@Test
public void testOptionalFromClause3() {
// $NON-NLS-1$
String sql = "SELECT * FROM /*+ optional */ t1 AS a, t2";
Query query = new Query();
Select select = new Select();
select.addSymbol(new MultipleElementSymbol());
query.setSelect(select);
From from = new From();
UnaryFromClause ufc = new UnaryFromClause();
// $NON-NLS-1$ //$NON-NLS-2$
ufc.setGroup(new GroupSymbol("a", "t1"));
ufc.setOptional(true);
from.addClause(ufc);
// $NON-NLS-1$
from.addGroup(new GroupSymbol("t2"));
query.setFrom(from);
// $NON-NLS-1$
TestParser.helpTest(sql, "SELECT * FROM /*+ optional */ t1 AS a, t2", query);
}
use of org.teiid.query.sql.symbol.MultipleElementSymbol in project teiid by teiid.
the class TestOptionsAndHints method testCacheScope.
@Test
public void testCacheScope() {
// $NON-NLS-1$
String sql = "/*+ cache(pref_mem scope:session) */ SELECT * FROM t1";
Query query = new Query();
Select select = new Select();
select.addSymbol(new MultipleElementSymbol());
query.setSelect(select);
From from = new From();
UnaryFromClause ufc = new UnaryFromClause();
from.addClause(ufc);
// $NON-NLS-1$
ufc.setGroup(new GroupSymbol("t1"));
query.setFrom(from);
CacheHint hint = new CacheHint();
hint.setScope(Scope.SESSION);
hint.setPrefersMemory(true);
query.setCacheHint(hint);
// $NON-NLS-1$
TestParser.helpTest(sql, "/*+ cache(pref_mem scope:SESSION) */ SELECT * FROM t1", query);
}
use of org.teiid.query.sql.symbol.MultipleElementSymbol in project teiid by teiid.
the class TestOptionsAndHints method testOptionalFromClause4.
@Test
public void testOptionalFromClause4() {
// $NON-NLS-1$
String sql = "SELECT * FROM t1, /*+ optional */ t2 as a";
Query query = new Query();
Select select = new Select();
select.addSymbol(new MultipleElementSymbol());
query.setSelect(select);
From from = new From();
// $NON-NLS-1$
from.addGroup(new GroupSymbol("t1"));
UnaryFromClause ufc = new UnaryFromClause();
// $NON-NLS-1$ //$NON-NLS-2$
ufc.setGroup(new GroupSymbol("a", "t2"));
ufc.setOptional(true);
from.addClause(ufc);
query.setFrom(from);
// $NON-NLS-1$
TestParser.helpTest(sql, "SELECT * FROM t1, /*+ optional */ t2 AS a", query);
}
use of org.teiid.query.sql.symbol.MultipleElementSymbol in project teiid by teiid.
the class TestOptionsAndHints method testOptionalFromClause1_2.
@Test
public void testOptionalFromClause1_2() {
// $NON-NLS-1$
String sql = "SELECT * FROM /*+optional */ t1, t2";
Query query = new Query();
Select select = new Select();
select.addSymbol(new MultipleElementSymbol());
query.setSelect(select);
From from = new From();
UnaryFromClause ufc = new UnaryFromClause();
// $NON-NLS-1$
ufc.setGroup(new GroupSymbol("t1"));
ufc.setOptional(true);
from.addClause(ufc);
// $NON-NLS-1$
from.addGroup(new GroupSymbol("t2"));
query.setFrom(from);
// $NON-NLS-1$
TestParser.helpTest(sql, "SELECT * FROM /*+ optional */ t1, t2", query);
}
use of org.teiid.query.sql.symbol.MultipleElementSymbol in project teiid by teiid.
the class TestOptionsAndHints method testOptionalFromClause1_1.
@Test
public void testOptionalFromClause1_1() {
// $NON-NLS-1$
String sql = "SELECT * FROM /*+ optional*/ t1, t2";
Query query = new Query();
Select select = new Select();
select.addSymbol(new MultipleElementSymbol());
query.setSelect(select);
From from = new From();
UnaryFromClause ufc = new UnaryFromClause();
// $NON-NLS-1$
ufc.setGroup(new GroupSymbol("t1"));
ufc.setOptional(true);
from.addClause(ufc);
// $NON-NLS-1$
from.addGroup(new GroupSymbol("t2"));
query.setFrom(from);
// $NON-NLS-1$
TestParser.helpTest(sql, "SELECT * FROM /*+ optional */ t1, t2", query);
}
Aggregations