@Override
  void execute() throws HiveMetaException {
    if (location == null && description == null) {
      throw new HiveMetaException("Asked to update catalog " + catName + " but not given any changes to update");
    }
    System.out.println("Updating catalog " + catName);

    Connection conn = schemaTool.getConnectionToMetastore(true);
    boolean success = false;
    try {
      conn.setAutoCommit(false);
      try (Statement stmt = conn.createStatement()) {
        Object updateLocation = location == null ? schemaTool.quote("<q>LOCATION_URI<q>") : "'" + location + "'";
        Object updateDescription = description == null ? schemaTool.quote("<qa>DESC<qa>") : "'" + description + "'";
        String update = String.format(schemaTool.quote(UPDATE_CATALOG_STMT), updateLocation, updateDescription,
            catName);
        LOG.debug("Going to run " + update);
        int count = stmt.executeUpdate(update);
        if (count != 1) {
          throw new HiveMetaException("Failed to find catalog " + catName + " to update");
        }
        conn.commit();
        success = true;
      }
    } catch (SQLException e) {
      throw new HiveMetaException("Failed to update catalog", e);
    } finally {
      try {
        if (!success) {
          conn.rollback();
        }
      } catch (SQLException e) {
        // Not really much we can do here.
        LOG.error("Failed to rollback, everything will probably go bad from here.", e);
      }
    }
  }
Print Hive version and schema version.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/tools/schematool/SchemaToolTaskAlterCatalog.java