Search in sources :

Example 1 with MultipleElementSymbol

use of org.teiid.query.sql.symbol.MultipleElementSymbol in project teiid by teiid.

the class TestStaticSymbolMappingVisitor method testVisitSelect2.

public void testVisitSelect2() {
    Select select = new Select();
    MultipleElementSymbol all = new MultipleElementSymbol();
    select.addSymbol(all);
    helpTest(select, getSymbolMap());
}
Also used : MultipleElementSymbol(org.teiid.query.sql.symbol.MultipleElementSymbol) Select(org.teiid.query.sql.lang.Select)

Example 2 with MultipleElementSymbol

use of org.teiid.query.sql.symbol.MultipleElementSymbol in project teiid by teiid.

the class TestStaticSymbolMappingVisitor method testVisitAllSymbol.

public void testVisitAllSymbol() {
    MultipleElementSymbol as = new MultipleElementSymbol();
    ArrayList elements = new ArrayList();
    elements.add(exampleElement(true, 0));
    elements.add(exampleElement(true, 1));
    as.setElementSymbols(elements);
    helpTest(as, getSymbolMap());
}
Also used : MultipleElementSymbol(org.teiid.query.sql.symbol.MultipleElementSymbol) ArrayList(java.util.ArrayList)

Example 3 with MultipleElementSymbol

use of org.teiid.query.sql.symbol.MultipleElementSymbol in project teiid by teiid.

the class TestStaticSymbolMappingVisitor method testVisitSelect4.

public void testVisitSelect4() {
    Select select = new Select();
    select.addSymbol(new ExpressionSymbol("x", // $NON-NLS-1$ //$NON-NLS-2$
    new Function("length", new Expression[] { exampleElement(true, 0) })));
    // $NON-NLS-1$
    select.addSymbol(new MultipleElementSymbol("abc.*"));
    select.addSymbol(exampleElement(true, 1));
    helpTest(select, getSymbolMap());
}
Also used : Function(org.teiid.query.sql.symbol.Function) MultipleElementSymbol(org.teiid.query.sql.symbol.MultipleElementSymbol) Select(org.teiid.query.sql.lang.Select) ExpressionSymbol(org.teiid.query.sql.symbol.ExpressionSymbol)

Example 4 with MultipleElementSymbol

use of org.teiid.query.sql.symbol.MultipleElementSymbol in project teiid by teiid.

the class TestSelect method sample1.

// ################################## TEST HELPERS ################################
public static final Select sample1() {
    List symbols = new ArrayList();
    // $NON-NLS-1$
    symbols.add(new ElementSymbol("a"));
    // $NON-NLS-1$
    symbols.add(new ElementSymbol("b"));
    Select select = new Select();
    MultipleElementSymbol all = new MultipleElementSymbol();
    all.setElementSymbols(symbols);
    select.addSymbol(all);
    return select;
}
Also used : ElementSymbol(org.teiid.query.sql.symbol.ElementSymbol) MultipleElementSymbol(org.teiid.query.sql.symbol.MultipleElementSymbol) MultipleElementSymbol(org.teiid.query.sql.symbol.MultipleElementSymbol) ArrayList(java.util.ArrayList) Select(org.teiid.query.sql.lang.Select) List(java.util.List) ArrayList(java.util.ArrayList)

Example 5 with MultipleElementSymbol

use of org.teiid.query.sql.symbol.MultipleElementSymbol in project teiid by teiid.

the class TestSelect method testGetProjectedWithStar.

public void testGetProjectedWithStar() {
    List symbols = new ArrayList();
    // $NON-NLS-1$
    symbols.add(new ElementSymbol("a"));
    // $NON-NLS-1$
    symbols.add(new ElementSymbol("b"));
    Select select = new Select();
    MultipleElementSymbol all = new MultipleElementSymbol();
    all.setElementSymbols(symbols);
    select.addSymbol(all);
    List projectedSymbols = select.getProjectedSymbols();
    // $NON-NLS-1$
    assertEquals("Did not get correct list for select *: ", symbols, projectedSymbols);
}
Also used : ElementSymbol(org.teiid.query.sql.symbol.ElementSymbol) MultipleElementSymbol(org.teiid.query.sql.symbol.MultipleElementSymbol) MultipleElementSymbol(org.teiid.query.sql.symbol.MultipleElementSymbol) ArrayList(java.util.ArrayList) Select(org.teiid.query.sql.lang.Select) List(java.util.List) ArrayList(java.util.ArrayList)

Aggregations

MultipleElementSymbol (org.teiid.query.sql.symbol.MultipleElementSymbol)41 GroupSymbol (org.teiid.query.sql.symbol.GroupSymbol)29 Test (org.junit.Test)27 Select (org.teiid.query.sql.lang.Select)19 Query (org.teiid.query.sql.lang.Query)14 From (org.teiid.query.sql.lang.From)12 SetQuery (org.teiid.query.sql.lang.SetQuery)11 ArrayList (java.util.ArrayList)10 Limit (org.teiid.query.sql.lang.Limit)10 UnaryFromClause (org.teiid.query.sql.lang.UnaryFromClause)10 Constant (org.teiid.query.sql.symbol.Constant)7 ElementSymbol (org.teiid.query.sql.symbol.ElementSymbol)7 Reference (org.teiid.query.sql.symbol.Reference)5 List (java.util.List)3 Expression (org.teiid.query.sql.symbol.Expression)2 Collection (java.util.Collection)1 QueryValidatorException (org.teiid.api.exception.query.QueryValidatorException)1 MultiSourceElement (org.teiid.dqp.internal.process.multisource.MultiSourceElement)1 TempMetadataID (org.teiid.query.metadata.TempMetadataID)1 PlanNode (org.teiid.query.optimizer.relational.plantree.PlanNode)1