Examples of ElementSymbol


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

    public void testSupportsAggregate12() throws Exception {       
        BasicSourceCapabilities caps = new BasicSourceCapabilities();
        caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
        caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MIN, true);
       
        AggregateSymbol aggregate = new AggregateSymbol("expr", NonReserved.MIN, false, new ElementSymbol("x")); //$NON-NLS-1$ //$NON-NLS-2$
       
        helpTestSupportsAggregateFunction(caps, aggregate, true);
    }   
View Full Code Here

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

    public void testSupportsAggregate13() throws Exception {       
        BasicSourceCapabilities caps = new BasicSourceCapabilities();
        caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
        caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, false);
       
        AggregateSymbol aggregate = new AggregateSymbol("expr", NonReserved.MAX, false, new ElementSymbol("x")); //$NON-NLS-1$ //$NON-NLS-2$
       
        helpTestSupportsAggregateFunction(caps, aggregate, false);
    }   
View Full Code Here

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

    public void testSupportsAggregate14() throws Exception {       
        BasicSourceCapabilities caps = new BasicSourceCapabilities();
        caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
        caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
       
        AggregateSymbol aggregate = new AggregateSymbol("expr", NonReserved.MAX, false, new ElementSymbol("x")); //$NON-NLS-1$ //$NON-NLS-2$
       
        helpTestSupportsAggregateFunction(caps, aggregate, true);
    }   
View Full Code Here

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

        BasicSourceCapabilities caps = new BasicSourceCapabilities();
        caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
        caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
        caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_DISTINCT, false);
       
        AggregateSymbol aggregate = new AggregateSymbol("expr", NonReserved.MAX, true, new ElementSymbol("x")); //$NON-NLS-1$ //$NON-NLS-2$
       
        helpTestSupportsAggregateFunction(caps, aggregate, false);
    }   
View Full Code Here

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

    GroupSymbol virtualGroup = child.getGroups().iterator().next();
    for (int i = updatedVirturalElement.size(); i < projectedViewSymbols.size(); i++) {
      SingleElementSymbol symbol = projectedViewSymbols.get(i);
      String name = symbol.getShortName();
            String virtualElementName = virtualGroup.getCanonicalName() + ElementSymbol.SEPARATOR + name;
            ElementSymbol virtualElement = new ElementSymbol(virtualElementName);
            virtualElement.setGroupSymbol(virtualGroup);
            virtualElement.setType(symbol.getType());
            virtualElement.setMetadataID(new TempMetadataID(virtualElementName, symbol.getType()));
            updatedVirturalElement.add(virtualElement);
    }
    SymbolMap newParentMap = SymbolMap.createSymbolMap(updatedVirturalElement, projectedViewSymbols);
    child.setProperty(NodeConstants.Info.SYMBOL_MAP, newParentMap);
    Map<AggregateSymbol, ElementSymbol> projectedMap = new HashMap<AggregateSymbol, ElementSymbol>();
View Full Code Here

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

        BasicSourceCapabilities caps = new BasicSourceCapabilities();
        caps.setCapabilitySupport(Capability.QUERY_AGGREGATES, true);
        caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_MAX, true);
        caps.setCapabilitySupport(Capability.QUERY_AGGREGATES_DISTINCT, true);
       
        AggregateSymbol aggregate = new AggregateSymbol("expr", NonReserved.MAX, true, new ElementSymbol("x")); //$NON-NLS-1$ //$NON-NLS-2$
       
        helpTestSupportsAggregateFunction(caps, aggregate, true);
    }   
View Full Code Here

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

      orderBy = (OrderBy)sortNode.getProperty(Info.SORT_ORDER);
      sortOrder = orderBy.getSortKeys();
    }
    List<SingleElementSymbol> projectCols = FrameUtil.findTopCols(unionSource);
    for (int i = 0; i < virtualElements.size(); i++) {
      ElementSymbol virtualElem = virtualElements.get(i);
      SingleElementSymbol projectedSymbol = projectCols.get(i);
      if (!projectedSymbol.getShortCanonicalName().equals(virtualElem.getShortCanonicalName())) {
        if (sortOrder != null) {
          int sortIndex = sortOrder.indexOf(projectedSymbol);
          if (sortIndex > -1) {
            updateSymbolName(sortOrder, sortIndex, virtualElem, sortOrder.get(sortIndex));
            orderBy.getOrderByItems().get(sortIndex).setSymbol(sortOrder.get(sortIndex));
View Full Code Here

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

        assertTrue("Expected variables size " + variableNames.length + " but was " + variables.size()//$NON-NLS-1$ //$NON-NLS-2$
                   variables.size() == variableNames.length);
        Iterator variablesIter = variables.iterator();
        for (int i=0; variablesIter.hasNext(); i++) {
            ElementSymbol variable = (ElementSymbol)variablesIter.next();
            assertTrue("Expected variable name " + variableNames[i] + " but was " + variable.getName()//$NON-NLS-1$ //$NON-NLS-2$
                       variable.getName().equalsIgnoreCase(variableNames[i]));
        }

        if (variableNames.length == 0){
            //There should be no TempMetadataIDs
            Collection symbols = CheckNoTempMetadataIDsVisitor.checkSymbols(query);
View Full Code Here

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

    }

  public static Collection<ElementSymbol> getVariables(LanguageObject languageObject) {
    Collection<ElementSymbol> variables = ElementCollectorVisitor.getElements(languageObject, false, true);
      for (Iterator<ElementSymbol> iterator = variables.iterator(); iterator.hasNext();) {
      ElementSymbol elementSymbol = iterator.next();
      if (!elementSymbol.isExternalReference()) {
        iterator.remove();
      }
    }
    return variables;
  }
View Full Code Here

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

    List elements = new ArrayList();
    ElementCollectorVisitor.getElements(langObj, elements);
    assertEquals("Wrong number of elements: ", elementNames.length, elements.size()); //$NON-NLS-1$

    for(int i=0; i<elements.size(); i++) {
      ElementSymbol symbol = (ElementSymbol) elements.get(i);
      assertEquals("Element name does not match: ", elementNames[i].toUpperCase(), symbol.getName().toUpperCase()); //$NON-NLS-1$
     
      FakeMetadataObject elementID = (FakeMetadataObject) symbol.getMetadataID();
      assertNotNull("ElementSymbol " + symbol + " was not resolved and has no metadataID", elementID); //$NON-NLS-1$ //$NON-NLS-2$
      assertEquals("ElementID name does not match: ", elementIDs[i].toUpperCase(), elementID.getName().toUpperCase()); //$NON-NLS-1$
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.