private boolean checkMetaStorePartitionLocation(Connection conn, URI[] defaultServers)
      throws HiveMetaException {
    String queryPartIDRange = schemaTool.quote(QUERY_PART_ID_RANGE);
    String queryPartLoc = schemaTool.quote(QUERY_PART_LOC);

    try {
      long maxID = 0, minID = 0;
      try (Statement stmt = conn.createStatement();
           ResultSet res = stmt.executeQuery(queryPartIDRange)) {
        if (res.next()) {
          maxID = res.getLong(1);
          minID = res.getLong(2);
        }
      }

      int numOfInvalid = 0;
      try (PreparedStatement pStmt = conn.prepareStatement(queryPartLoc)) {
        while (minID <= maxID) {
          pStmt.setLong(1, minID);
          pStmt.setLong(2, minID + PART_LOC_CHECK_SIZE);
          try (ResultSet res = pStmt.executeQuery()) {
            while (res.next()) {
              String locValue = res.getString(3);
              String entity = "Database " + getNameOrID(res, 7, 6) + ", Table "  + getNameOrID(res, 5, 4) +
                  ", Partition " + getNameOrID(res, 2, 1);
              if (!checkLocation(entity, locValue, defaultServers)) {
                numOfInvalid++;
              }
            }
          }
          minID += PART_LOC_CHECK_SIZE + 1;
        }
      }

      return numOfInvalid == 0;
    } catch (SQLException e) {
      throw new HiveMetaException("Failed to get Partition Location Info.", e);
    }
  }
Print Hive version and schema version.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskValidate.java