@Override
  void execute() throws HiveMetaException {
    System.out.println("Starting metastore validation\n");
    Connection conn = schemaTool.getConnectionToMetastore(false);
    boolean success = true;
    try {
      success &= validateSchemaVersions();
      success &= validateSequences(conn);
      success &= validateSchemaTables(conn);
      success &= validateLocations(conn, schemaTool.getValidationServers());
      success &= validateColumnNullValues(conn);
    } finally {
      if (conn != null) {
        try {
          conn.close();
        } catch (SQLException e) {
          throw new HiveMetaException("Failed to close metastore connection", e);
        }
      }
    }

    System.out.print("Done with metastore validation: ");
    if (!success) {
      System.out.println("[FAIL]");
      throw new HiveMetaException("Validation failed");
    } else {
      System.out.println("[SUCCESS]");
    }
  }
Print Hive version and schema version.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskValidate.java