Examples of parseCommand()


Examples of net.eldiosantos.command.core.Interpreter.parseCommand()

    do {
      System.out.print("shell: ");
      cmd = sc.nextLine();

      interpreter.parseCommand(cmd);

    } while (!cmd.equals("exit"));
  }
}
View Full Code Here

Examples of org.teiid.cdk.api.TranslationUtility.parseCommand()

      }
      if (pushdowns != null) {
        methods.addAll(pushdowns);
      }
      util.setUDF(methods);
      return util.parseCommand(sql);
    }   

  public static void helpTestVisitor(String vdb, String input, String expectedOutput, JDBCExecutionFactory translator) throws TranslatorException {
    helpTestVisitor(vdb,null,input, expectedOutput, translator);
  }
View Full Code Here

Examples of org.teiid.cdk.api.TranslationUtility.parseCommand()

    }

    private void helpTestVisitor(String vdb, String input, ExecutionContext context, String dbmsTimeZone, String expectedOutput, boolean correctNaming) throws TranslatorException {
        // Convert from sql to objects
        TranslationUtility util = new TranslationUtility(vdb);
        Command obj =  util.parseCommand(input, correctNaming, true);       
    this.helpTestVisitor(obj, context, dbmsTimeZone, expectedOutput);
    }

    /** Helper method takes a QueryMetadataInterface impl instead of a VDB filename
     * @throws TranslatorException
View Full Code Here

Examples of org.teiid.cdk.api.TranslationUtility.parseCommand()

        return UnitTestUtil.getTestDataPath() + "/PartsSupplier.vdb"; //$NON-NLS-1$
    }
   
    public void helpTestTranslate(String sql, String expectedOutput) {
        TranslationUtility util = new TranslationUtility(getTestVDB());
        Command query = util.parseCommand(sql);        
        assertEquals(expectedOutput, query.toString());       
    }

    public void testQuery1() {
        helpTestTranslate(
View Full Code Here

Examples of org.teiid.cdk.api.TranslationUtility.parseCommand()

    public void testGetRMD() throws Exception {
        TranslationUtility util = new TranslationUtility(getTestVDB());
       
        // Translate command to get some ids
        Select query = (Select) util.parseCommand("select * from partssupplier.parts"); //$NON-NLS-1$
        NamedTable group = (NamedTable) query.getFrom().get(0);
        AbstractMetadataRecord mid = group.getMetadataObject();
        assertEquals("PartsSupplier.PARTSSUPPLIER.PARTS", mid.getFullName()); //$NON-NLS-1$
       
        // Use RMD to get stuff
View Full Code Here

Examples of org.teiid.cdk.api.TranslationUtility.parseCommand()

       
        CompositeMetadataStore store = new CompositeMetadataStore(metadataStore);
        QueryMetadataInterface metadata = new TransformationMetadata(null, store, null, FakeMetadataFactory.SFM.getSystemFunctions(), null);
       
        TranslationUtility tu = new TranslationUtility(metadata);
        Command command = tu.parseCommand("select max(x) from bar"); //$NON-NLS-1$
        TranslationHelper.helpTestVisitor("SELECT MAX(cast(bar.x as char(36))) FROM bar", trans, command); //$NON-NLS-1$
       
        command = tu.parseCommand("select * from (select max(x) as max from bar) x"); //$NON-NLS-1$
        TranslationHelper.helpTestVisitor("SELECT x.max FROM (SELECT MAX(cast(bar.x as char(36))) AS max FROM bar) x", trans, command); //$NON-NLS-1$
    }
View Full Code Here

Examples of org.teiid.cdk.api.TranslationUtility.parseCommand()

       
        TranslationUtility tu = new TranslationUtility(metadata);
        Command command = tu.parseCommand("select max(x) from bar"); //$NON-NLS-1$
        TranslationHelper.helpTestVisitor("SELECT MAX(cast(bar.x as char(36))) FROM bar", trans, command); //$NON-NLS-1$
       
        command = tu.parseCommand("select * from (select max(x) as max from bar) x"); //$NON-NLS-1$
        TranslationHelper.helpTestVisitor("SELECT x.max FROM (SELECT MAX(cast(bar.x as char(36))) AS max FROM bar) x", trans, command); //$NON-NLS-1$
    }
   
    @Test public void testRowLimitWithInlineViewOrderBy() throws Exception {
        String input = "select intkey from (select intkey from bqt1.smalla) as x order by intkey limit 100"; //$NON-NLS-1$
View Full Code Here

Examples of org.teiid.cdk.api.TranslationUtility.parseCommand()

    private Condition convertCriteria(String criteriaStr) {
        // Create ICriteria from criteriaStr
        TranslationUtility util = FakeTranslationFactory.getInstance().getBQTTranslationUtility();
        String sql = "SELECT IntKey FROM BQT1.SmallA WHERE " + criteriaStr; //$NON-NLS-1$
        Select query = (Select) util.parseCommand(sql);
        Condition criteria = query.getWhere();
        return criteria;
    }
   
    public void helpTestSeparateByAnd(String criteriaStr, String[] expected) throws Exception {
View Full Code Here

Examples of org.teiid.query.parser.QueryParser.parseCommand()

                                            String procedureType) throws TeiidComponentException,
                                                                 QueryMetadataException, TeiidProcessingException {
        QueryMetadataInterface metadata = FakeMetadataFactory.exampleUpdateProc(procedureType, procedure);

        QueryParser parser = QueryParser.getQueryParser();
        Command userCommand = userQuery != null ? parser.parseCommand(userQuery) : parser.parseCommand(procedure);
       
        if (userCommand instanceof CreateUpdateProcedureCommand) {
          GroupSymbol gs = new GroupSymbol("proc");
          gs.setMetadataID(new TempMetadataID("proc", Collections.EMPTY_LIST));
          ((CreateUpdateProcedureCommand)userCommand).setVirtualGroup(gs);
View Full Code Here

Examples of org.teiid.query.parser.QueryParser.parseCommand()

                                            String procedureType) throws TeiidComponentException,
                                                                 QueryMetadataException, TeiidProcessingException {
        QueryMetadataInterface metadata = FakeMetadataFactory.exampleUpdateProc(procedureType, procedure);

        QueryParser parser = QueryParser.getQueryParser();
        Command userCommand = userQuery != null ? parser.parseCommand(userQuery) : parser.parseCommand(procedure);
       
        if (userCommand instanceof CreateUpdateProcedureCommand) {
          GroupSymbol gs = new GroupSymbol("proc");
          gs.setMetadataID(new TempMetadataID("proc", Collections.EMPTY_LIST));
          ((CreateUpdateProcedureCommand)userCommand).setVirtualGroup(gs);
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.