public static void main(String[] args) {
    MetastoreSchemaTool tool = new HiveSchemaTool();
    OptionGroup additionalGroup = new OptionGroup();
    Option metaDbTypeOpt = OptionBuilder.withArgName("metaDatabaseType")
        .hasArgs().withDescription("Used only if upgrading the system catalog for hive")
        .create("metaDbType");
    additionalGroup.addOption(metaDbTypeOpt);
    System.setProperty(MetastoreConf.ConfVars.SCHEMA_VERIFICATION.getVarname(), "true");
    System.exit(tool.run(findHomeDir(), args, additionalGroup,
        MetastoreConf.newMetastoreConf()));
  }
Run beeline with the given metastore script. Flatten the nested scripts
into single file.
beeline/src/java/org/apache/hive/beeline/schematool/HiveSchemaTool.java