@VisibleForTesting
  public final int runScript(String[] args, InputStream scriptStream) {
    try {
      init(findHomeDir(), args, null, MetastoreConf.newMetastoreConf());
      // Cannot run script directly from input stream thus copy is necessary.
      File scriptFile = File.createTempFile("schemaToolTmpScript", "sql");
      scriptFile.deleteOnExit();
      FileUtils.copyToFile(scriptStream, scriptFile);
      execSql(scriptFile.getAbsolutePath());
      return 0;
    } catch (HiveMetaException | IOException e) {
      throw new RuntimeException("Failed to run script " + scriptStream, e);
    }
  }
Execute a given metastore script. This default version uses sqlline to execute the files,
which requires only running one file.  Subclasses can use other executors.
@param scriptDir directory script is in
@param scriptFile file in the directory to run
@throws IOException if it cannot read the file or directory
@throws HiveMetaException default implementation never throws this
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/MetastoreSchemaTool.java