Examples of NestedScriptParser


Examples of org.apache.hive.beeline.HiveSchemaHelper.NestedScriptParser

      "DROP TABLE footab",
    };
    String expectedSQL = StringUtils.join(resultScript, System.getProperty("line.separator")) +
        System.getProperty("line.separator");
    File testScriptFile = generateTestScript(testScript);
    NestedScriptParser testDbParser = HiveSchemaHelper.getDbCommandParser("mysql");
    String flattenedSql = HiveSchemaTool.buildCommand(testDbParser,
        testScriptFile.getParentFile().getPath(), testScriptFile.getName());

    assertEquals(expectedSQL, flattenedSql);
  }
View Full Code Here

Examples of org.apache.hive.beeline.HiveSchemaHelper.NestedScriptParser

    };

    String expectedSQL = StringUtils.join(parsedScript, System.getProperty("line.separator")) +
        System.getProperty("line.separator");
    File testScriptFile = generateTestScript(testScript);
    NestedScriptParser testDbParser = HiveSchemaHelper.getDbCommandParser("mysql");
    String flattenedSql = HiveSchemaTool.buildCommand(testDbParser,
        testScriptFile.getParentFile().getPath(), testScriptFile.getName());

    assertEquals(expectedSQL, flattenedSql);
  }
View Full Code Here

Examples of org.apache.hive.beeline.HiveSchemaHelper.NestedScriptParser

    return sb.toString();
  }

  // run beeline on the given metastore scrip, flatten the nested scripts into single file
  private void runBeeLine(String scriptDir, String scriptFile) throws IOException {
    NestedScriptParser dbCommandParser =
        HiveSchemaHelper.getDbCommandParser(dbType);
    // expand the nested script
    String sqlCommands = buildCommand(dbCommandParser, scriptDir, scriptFile);
    File tmpFile = File.createTempFile("schematool", ".sql");
    tmpFile.deleteOnExit();
View Full Code Here

Examples of org.apache.hive.beeline.HiveSchemaHelper.NestedScriptParser

      "DROP TABLE footab",
    };
    String expectedSQL = StringUtils.join(resultScript, System.getProperty("line.separator")) +
        System.getProperty("line.separator");
    File testScriptFile = generateTestScript(testScript);
    NestedScriptParser testDbParser = HiveSchemaHelper.getDbCommandParser("mysql");
    String flattenedSql = HiveSchemaTool.buildCommand(testDbParser,
        testScriptFile.getParentFile().getPath(), testScriptFile.getName());

    assertEquals(expectedSQL, flattenedSql);
  }
View Full Code Here

Examples of org.apache.hive.beeline.HiveSchemaHelper.NestedScriptParser

    };

    String expectedSQL = StringUtils.join(parsedScript, System.getProperty("line.separator")) +
        System.getProperty("line.separator");
    File testScriptFile = generateTestScript(testScript);
    NestedScriptParser testDbParser = HiveSchemaHelper.getDbCommandParser("mysql");
    String flattenedSql = HiveSchemaTool.buildCommand(testDbParser,
        testScriptFile.getParentFile().getPath(), testScriptFile.getName());

    assertEquals(expectedSQL, flattenedSql);
  }
View Full Code Here

Examples of org.apache.hive.beeline.HiveSchemaHelper.NestedScriptParser

      "DROP TABLE footab",
    };
    String expectedSQL = StringUtils.join(resultScript, System.getProperty("line.separator")) +
        System.getProperty("line.separator");
    File testScriptFile = generateTestScript(testScript);
    NestedScriptParser testDbParser = HiveSchemaHelper.getDbCommandParser("mysql");
    String flattenedSql = testDbParser.buildCommand(testScriptFile.getParentFile().getPath(),
        testScriptFile.getName());

    assertEquals(expectedSQL, flattenedSql);
  }
View Full Code Here

Examples of org.apache.hive.beeline.HiveSchemaHelper.NestedScriptParser

    };

    String expectedSQL = StringUtils.join(parsedScript, System.getProperty("line.separator")) +
        System.getProperty("line.separator");
    File testScriptFile = generateTestScript(testScript);
    NestedScriptParser testDbParser = HiveSchemaHelper.getDbCommandParser("mysql");
    String flattenedSql = testDbParser.buildCommand(testScriptFile.getParentFile().getPath(),
        testScriptFile.getName());

    assertEquals(expectedSQL, flattenedSql);
  }
View Full Code Here

Examples of org.apache.hive.beeline.HiveSchemaHelper.NestedScriptParser

   * Run beeline with the given metastore script. Flatten the nested scripts
   * into single file.
   */
  private void runBeeLine(String scriptDir, String scriptFile)
      throws IOException, HiveMetaException {
    NestedScriptParser dbCommandParser = getDbCommandParser(dbType);
    // expand the nested script
    String sqlCommands = dbCommandParser.buildCommand(scriptDir, scriptFile);
    File tmpFile = File.createTempFile("schematool", ".sql");
    tmpFile.deleteOnExit();

    // write out the buffer into a file. Add beeline commands for autocommit and close
    FileWriter fstream = new FileWriter(tmpFile.getPath());
View Full Code Here

Examples of org.apache.sentry.provider.db.tools.SentrySchemaHelper.NestedScriptParser

    return sb.toString();
  }

  // run beeline on the given sentry store scrip, flatten the nested scripts into single file
  private void runBeeLine(String scriptDir, String scriptFile) throws IOException {
    NestedScriptParser dbCommandParser =
        SentrySchemaHelper.getDbCommandParser(dbType);
    dbCommandParser.setDbOpts(getDbOpts());
    // expand the nested script
    String sqlCommands = buildCommand(dbCommandParser, scriptDir, scriptFile);
    File tmpFile = File.createTempFile("schematool", ".sql");
    tmpFile.deleteOnExit();
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.