code: private void cancelDelegationToken() throws HiveSQLException {
      if (delegationTokenStr != null) {
        try {
          Hive.get(getHiveConf()).cancelDelegationToken(delegationTokenStr);
        } catch (HiveException e) {
          throw new HiveSQLException("Couldn't cancel delegation token", e);
        }
        // close the metastore connection created with this delegation token
        Hive.closeCurrent();
      }
    }
docs: If the session has a delegation token obtained from the metastore, then cancel it