code: public String getDelegationToken(String owner, String renewer) throws HiveSQLException {
      if (saslServer == null) {
        throw new HiveSQLException(
            "Delegation token only supported over kerberos authentication", "08S01");
      }
  
      try {
        String tokenStr = saslServer.getDelegationTokenWithService(owner, renewer, HS2_CLIENT_TOKEN);
        if (tokenStr == null || tokenStr.isEmpty()) {
          throw new HiveSQLException(
              "Received empty retrieving delegation token for user " + owner, "08S01");
        }
        return tokenStr;
      } catch (IOException e) {
        throw new HiveSQLException(
            "Error retrieving delegation token for user " + owner, "08S01", e);
      } catch (InterruptedException e) {
        throw new HiveSQLException("delegation token retrieval interrupted", "08S01", e);
      }
    }
docs: retrieve delegation token for the given user