Examples of QueryParser


Examples of org.teiid.query.parser.QueryParser

    }

    @Test public void testDefect9917() throws Exception{
      QueryMetadataInterface metadata = FakeMetadataFactory.example1Cached();
        String sql = "SELECT lookup('pm1.g1', 'e1a', 'e2', e2) AS x, lookup('pm1.g1', 'e4', 'e3', e3) AS y FROM pm1.g1"; //$NON-NLS-1$
        Command command = new QueryParser().parseCommand(sql);
        try{
          QueryResolver.resolveCommand(command, metadata);
          fail("Did not get exception"); //$NON-NLS-1$
        }catch(QueryResolverException e){
          //expected
        }
       
        sql = "SELECT lookup('pm1.g1a', 'e1', 'e2', e2) AS x, lookup('pm1.g1', 'e4', 'e3', e3) AS y FROM pm1.g1"; //$NON-NLS-1$
        command = new QueryParser().parseCommand(sql);
        try{
          QueryResolver.resolveCommand(command, metadata);
          fail("Did not get exception"); //$NON-NLS-1$
        }catch(QueryResolverException e){
          //expected
View Full Code Here

Examples of org.teiid.query.parser.QueryParser

        ValidatorReport report = Validator.validate(command, metadata);
        assertEquals("The aggregate function SUM cannot be used with non-numeric expressions: SUM(DISTINCT lookup('pm1.g1', 'e3', 'e2', e2))", report.toString()); //$NON-NLS-1$
    }
   
    private ValidatorReport helpValidateInModeler(String procName, String procSql, QueryMetadataInterface metadata) throws Exception {
        Command command = new QueryParser().parseCommand(procSql);
       
        GroupSymbol group = new GroupSymbol(procName);
        QueryResolver.resolveCommand(command, group, Command.TYPE_STORED_PROCEDURE, metadata);
       
        // Validate
View Full Code Here

Examples of org.teiid.query.parser.QueryParser

 
  @Test public void testDefect14886() throws Exception{       
        String sql = "CREATE VIRTUAL PROCEDURE BEGIN END"//$NON-NLS-1$       
        QueryMetadataInterface metadata = FakeMetadataFactory.example1Cached();
       
        Command command = new QueryParser().parseCommand(sql);
        QueryResolver.resolveCommand(command, metadata);
       
        // Validate
        ValidatorReport report = Validator.validate(command, metadata);
        // Validate
View Full Code Here

Examples of org.teiid.query.parser.QueryParser

        String sql = "CREATE VIRTUAL PROCEDURE BEGIN SELECT * INTO #temptable FROM pm1.g1; INSERT INTO #temptable (e1) VALUES ('a'); END"; //$NON-NLS-1$     
        FakeMetadataFacade metadata = FakeMetadataFactory.example1();
        FakeMetadataObject e1 = metadata.getStore().findObject("pm1.g1.e1", FakeMetadataObject.ELEMENT); //$NON-NLS-1$
        e1.putProperty(FakeMetadataObject.Props.UPDATE, Boolean.FALSE);
       
        Command command = new QueryParser().parseCommand(sql);
        QueryResolver.resolveCommand(command, metadata);
       
        // Validate
        ValidatorReport report = Validator.validate(command, metadata);
        // Validate
View Full Code Here

Examples of tosa.loader.parser.QueryParser

      protected SelectStatement init() {
        try {
          InputStream is = _sql.openInputStream();
          String content = new String(StreamUtil.getContent(is));
          is.close();
          QueryParser parser = new QueryParser(Token.tokenize(content), _db.getDBData());
          return parser.parseTopLevelSelect();
        } catch (IOException e) {
          throw GosuExceptionUtil.forceThrow(e);
        }
      }
    };
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.