@VisibleForTesting
  List<String> findCreateTable(String path, List<String> tableList) throws Exception {
    if (!(new File(path)).exists()) {
      throw new Exception(path + " does not exist. Potentially incorrect version in the metastore VERSION table");
    }

    List<String> subs = new ArrayList<>();
    NestedScriptParser sp = HiveSchemaHelper.getDbCommandParser(schemaTool.getDbType(), false);
    Pattern regexp = Pattern.compile("CREATE TABLE(\\s+IF NOT EXISTS)?\\s+(\\S+).*");

    try (BufferedReader reader = new BufferedReader(new FileReader(path))) {
      String line = null;
      while ((line = reader.readLine()) != null) {
        if (sp.isNestedScript(line)) {
          String subScript = sp.getScriptName(line);
          LOG.debug("Schema subscript " + subScript + " found");
          subs.add(subScript);
          continue;
        }
        line = line.replaceAll("( )+", " "); //suppress multi-spaces
        line = line.replaceAll("\\(", " ");
        line = line.replaceAll("IF NOT EXISTS ", "");
        line = line.replaceAll("`", "");
        line = line.replaceAll("'", "");
        line = line.replaceAll("\"", "");
        Matcher matcher = regexp.matcher(line);

        if (matcher.find()) {
          String table = matcher.group(2);
          if (schemaTool.getDbType().equals("derby")) {
            table = table.replaceAll("APP\\.", "");
          }
          tableList.add(table.toLowerCase());
          LOG.debug("Found table " + table + " in the schema");
        }
      }
    } catch (IOException ex){
      throw new Exception(ex.getMessage());
    }

    return subs;
  }
Print Hive version and schema version.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskValidate.java