private boolean catalogExists(Statement stmt) throws SQLException {
    String query = String.format(schemaTool.quote(CATALOG_EXISTS_QUERY), catName);
    LOG.debug("Going to run " + query);
    try (ResultSet rs = stmt.executeQuery(query)) {
      if (rs.next()) {
        System.out.println("Catalog " + catName + " already exists");
        return true;
      }
    }

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