use of org.teiid.query.sql.symbol.GroupSymbol in project teiid by teiid.
the class TestLoopStatement method query2.
public static final Query query2() {
Query q1 = new Query();
Select select = new Select();
// $NON-NLS-1$
select.addSymbol(new ElementSymbol("x2"));
q1.setSelect(select);
From from = new From();
// $NON-NLS-1$
from.addGroup(new GroupSymbol("g2"));
q1.setFrom(from);
return q1;
}
use of org.teiid.query.sql.symbol.GroupSymbol in project teiid by teiid.
the class TestDynamicCommand method testClone1.
public void testClone1() {
List symbols = new ArrayList();
// $NON-NLS-1$
ElementSymbol a1 = new ElementSymbol("a1");
a1.setType(DataTypeManager.DefaultDataClasses.STRING);
symbols.add(a1);
DynamicCommand sqlCmd = new DynamicCommand();
// $NON-NLS-1$
Expression sql = new Constant("SELECT a1 FROM g WHERE a2 = 5");
sqlCmd.setSql(sql);
sqlCmd.setAsColumns(symbols);
sqlCmd.setAsClauseSet(true);
// $NON-NLS-1$
sqlCmd.setIntoGroup(new GroupSymbol("#g"));
UnitTestUtil.helpTestEquivalence(0, sqlCmd, sqlCmd.clone());
}
use of org.teiid.query.sql.symbol.GroupSymbol in project teiid by teiid.
the class TestDynamicCommand method testClone2.
public void testClone2() {
List symbols = new ArrayList();
// $NON-NLS-1$
ElementSymbol a1 = new ElementSymbol("a1");
a1.setType(DataTypeManager.DefaultDataClasses.STRING);
symbols.add(a1);
// $NON-NLS-1$
Expression sql = new Constant("SELECT * FROM g");
SetClauseList using = new SetClauseList();
using.addClause(a1, a1);
// $NON-NLS-1$
DynamicCommand sqlCmd = new DynamicCommand(sql, symbols, new GroupSymbol("#g"), using);
UnitTestUtil.helpTestEquivalence(0, sqlCmd, sqlCmd.clone());
}
use of org.teiid.query.sql.symbol.GroupSymbol in project teiid by teiid.
the class TestASTQueries method sampleQuery.
private Query sampleQuery() {
List<ElementSymbol> symbols = new ArrayList<ElementSymbol>();
// $NON-NLS-1$
symbols.add(new ElementSymbol("e1"));
// $NON-NLS-1$
symbols.add(new ElementSymbol("e2"));
Select select = new Select(symbols);
From from = new From();
// $NON-NLS-1$
from.addGroup(new GroupSymbol("G1"));
Query query = new Query();
query.setSelect(select);
query.setFrom(from);
return query;
}
use of org.teiid.query.sql.symbol.GroupSymbol in project teiid by teiid.
the class DataTierManagerImpl method getColumns.
private List<ElementSymbol> getColumns(TransformationMetadata tm, String name) {
GroupSymbol gs = new GroupSymbol(name);
try {
ResolverUtil.resolveGroup(gs, tm);
List<ElementSymbol> columns = ResolverUtil.resolveElementsInGroup(gs, tm);
return columns;
} catch (TeiidException e) {
throw new TeiidRuntimeException(e);
}
}
Aggregations