Package org.teiid.query.sql.symbol

Examples of org.teiid.query.sql.symbol.GroupSymbol


              }
              break;
        }
        default: {
          if (root.getType() == NodeConstants.Types.PROJECT) {
            GroupSymbol intoGroup = (GroupSymbol)root.getProperty(NodeConstants.Info.INTO_GROUP);
                if (intoGroup != null) { //if this is a project into, treat the nodes under the source as a new plan root
                    PlanNode intoRoot = NodeEditor.findNodePreOrder(root, NodeConstants.Types.SOURCE);
                    execute(intoRoot.getFirstChild(), metadata, capFinder, rules, analysisRecord, context);
                    return;
                }
View Full Code Here


      this.group = group;
    }

    public GroupSymbol getGroup() {
        if(group == null) {
            return new GroupSymbol(this.getProcedureCallableName());
        }
        return group;
    }
View Full Code Here

    From from = query.getFrom();
    List groups = from.getGroups();     
    assertEquals("Wrong number of group IDs: ", groupIDs.length, groups.size()); //$NON-NLS-1$
   
    for(int i=0; i<groups.size(); i++) {
      GroupSymbol group = (GroupSymbol) groups.get(i);
            String matchString = null;
            if(group.getMetadataID() instanceof FakeMetadataObject) {
                matchString = ((FakeMetadataObject)group.getMetadataID()).getName();
            } else if(group.getMetadataID() instanceof TempMetadataID) {
                matchString = ((TempMetadataID)group.getMetadataID()).getID();
            }
      assertEquals("Group ID does not match: ", groupIDs[i].toUpperCase(), matchString.toUpperCase()); //$NON-NLS-1$
    }
  }
View Full Code Here

    }      

    @Test public void testCriteria1() {                 
        CompareCriteria expected = new CompareCriteria();
        ElementSymbol es = new ElementSymbol("pm1.g1.e1"); //$NON-NLS-1$
        GroupSymbol gs = new GroupSymbol("pm1.g1"); //$NON-NLS-1$
        es.setGroupSymbol(gs);
        expected.setLeftExpression(es);
        expected.setOperator(CompareCriteria.EQ);
        expected.setRightExpression(new Constant("abc")); //$NON-NLS-1$
View Full Code Here

        Command command = QueryParser.getQueryParser().parseCommand("EXEC pm1.sq2(pm1.sq2.in)"); //$NON-NLS-1$

        // resolve
        try {
            // Construct command metadata
            GroupSymbol sqGroup = new GroupSymbol("pm1.sq5"); //$NON-NLS-1$
            ArrayList sqParams = new ArrayList();
            ElementSymbol in = new ElementSymbol("pm1.sq5.in1"); //$NON-NLS-1$
            in.setType(DataTypeManager.DefaultDataClasses.STRING);
            sqParams.add(in);
            Map externalMetadata = new HashMap();
View Full Code Here

    //sub command
    Select innerSelect = new Select();
    ElementSymbol e2inner = new ElementSymbol("e2"); //$NON-NLS-1$
    innerSelect.addSymbol(e2inner);
    From innerFrom = new From();
    GroupSymbol pm4g1 = new GroupSymbol("pm4.g1"); //$NON-NLS-1$
    innerFrom.addGroup(pm4g1);
    Query innerQuery = new Query();
    innerQuery.setSelect(innerSelect);
    innerQuery.setFrom(innerFrom);
   
    //outer command
    Select outerSelect = new Select();
    ElementSymbol e1 = new ElementSymbol("e1"); //$NON-NLS-1$
      outerSelect.addSymbol(e1);
    From outerFrom = new From();
      GroupSymbol pm1g1 = new GroupSymbol("pm1.g1"); //$NON-NLS-1$
    outerFrom.addGroup(pm1g1);
      ElementSymbol e2outer = new ElementSymbol("e2"); //$NON-NLS-1$
    SubquerySetCriteria crit = new SubquerySetCriteria(e2outer, innerQuery);
      Query outerQuery = new Query();
      outerQuery.setSelect(outerSelect);
View Full Code Here

    //sub command
    Select innerSelect = new Select();
    ElementSymbol e1inner = new ElementSymbol("e1"); //$NON-NLS-1$
    innerSelect.addSymbol(e1inner);
    From innerFrom = new From();
    GroupSymbol pm4g1 = new GroupSymbol("pm4.g1"); //$NON-NLS-1$
    innerFrom.addGroup(pm4g1);
    Query innerQuery = new Query();
    innerQuery.setSelect(innerSelect);
    innerQuery.setFrom(innerFrom);
   
    //outer command
    Select outerSelect = new Select();
    ElementSymbol e1 = new ElementSymbol("e1"); //$NON-NLS-1$
    outerSelect.addSymbol(e1);
    From outerFrom = new From();
    GroupSymbol pm1g1 = new GroupSymbol("pm1.g1"); //$NON-NLS-1$
    outerFrom.addGroup(pm1g1);
    ElementSymbol e2 = new ElementSymbol("e2"); //$NON-NLS-1$
    SubquerySetCriteria crit = new SubquerySetCriteria(e2, innerQuery);
    Query outerQuery = new Query();
    outerQuery.setSelect(outerSelect);
View Full Code Here

    //sub command
    Select innerSelect = new Select();
    ElementSymbol e2inner = new ElementSymbol("e2"); //$NON-NLS-1$
    innerSelect.addSymbol(e2inner);
    From innerFrom = new From();
    GroupSymbol pm4g1 = new GroupSymbol("pm4.g1"); //$NON-NLS-1$
    innerFrom.addGroup(pm4g1);
    Query innerQuery = new Query();
    innerQuery.setSelect(innerSelect);
    innerQuery.setFrom(innerFrom);

    //outer command
    Select outerSelect = new Select();
    ElementSymbol e1 = new ElementSymbol("e1"); //$NON-NLS-1$
    outerSelect.addSymbol(e1);
    From outerFrom = new From();
    GroupSymbol pm1g1 = new GroupSymbol("pm1.g1"); //$NON-NLS-1$
    outerFrom.addGroup(pm1g1);
    SubquerySetCriteria crit = new SubquerySetCriteria(e1, innerQuery);
    Query outerQuery = new Query();
    outerQuery.setSelect(outerSelect);
    outerQuery.setFrom(outerFrom);
View Full Code Here

    }

    @Test public void test11716() throws Exception {
      String sql = "SELECT e1 FROM pm1.g1 where e1='1'"; //$NON-NLS-1$
      Map externalMetadata = new HashMap();
      GroupSymbol inputSet = new GroupSymbol("INPUT"); //$NON-NLS-1$
      List inputSetElements = new ArrayList();
      ElementSymbol inputSetElement = new ElementSymbol("INPUT.e1"); //$NON-NLS-1$
      inputSetElements.add(inputSetElement);
      externalMetadata.put(inputSet, inputSetElements);
        Query command = (Query)helpParse(sql);
View Full Code Here

     * to be lost if currently in a HashMap or HashSet.
     * @param name New name
     * @since 4.3
     */
    public void setName(String name) {
        this.symbol = new GroupSymbol(name);
    }
View Full Code Here

TOP

Related Classes of org.teiid.query.sql.symbol.GroupSymbol

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.