Flink UDAF ValidationException when using HashSet/HashMap

I am trying to write a Flink User Defined Aggregate Function (UDAF) for aggregation :

/**
 * A custom Aggregate Function (UDAF) for aggregating click events.
 * This UDAF aggregates click actions and click tags, and keeps track of the earliest timestamp and click type.
 * The results are stored in a map with keys as event1 and event2.
 */
public class ClickEventAggregator extends AggregateFunction<ClickEventAggregator.AggregateResult, ClickEventAggregator.AggregateAccumulator> {

  @Override
  public AggregateAccumulator createAccumulator() {
    return new AggregateAccumulator();
  }

  @Override
  public AggregateResult getValue(AggregateAccumulator accumulator) {
    Map<String, String> result = new HashMap<>();
    if (!accumulator.actionSet.isEmpty()) {
      result.put("event1", String.join(",", accumulator.actionSet));
    }
    if (!accumulator.tagSet.isEmpty()) {
      result.put("event2", String.join(",", accumulator.tagSet));
    }
    return new AggregateResult(result, accumulator.firstTimestamp, accumulator.type);
  }

  public void accumulate(AggregateAccumulator accumulator, String action, String clickTag, Long timestamp, Integer type) {
    if (accumulator.firstTimestamp == null || timestamp < accumulator.firstTimestamp) {
      accumulator.firstTimestamp = timestamp;
      accumulator.type = type;
    }
    if (action != null && !action.isEmpty()) {
      accumulator.actionSet.add(action);
    }
    if (clickTag != null && !clickTag.isEmpty()) {
      accumulator.tagSet.add(clickTag);
    }
  }

  public void merge(AggregateAccumulator accumulator, Iterable<AggregateAccumulator> others) {
    for (AggregateAccumulator other : others) {
      if (accumulator.firstTimestamp == null || (other.firstTimestamp != null && other.firstTimestamp < accumulator.firstTimestamp)) {
        accumulator.firstTimestamp = other.firstTimestamp;
        accumulator.type = other.type;
      }
      accumulator.actionSet.addAll(other.actionSet);
      accumulator.tagSet.addAll(other.tagSet);
    }
  }

  public static class AggregateAccumulator {
    public Long firstTimestamp;
    public HashSet<String> actionSet = new HashSet<>();
    public HashSet<String> tagSet = new HashSet<>();
    public Integer type;
  }

  public static class AggregateResult {
    public Map<String, String> eventMap;
    public Long firstTimestamp;
    public Integer type;

    public AggregateResult(Map<String, String> eventMap, Long firstTimestamp, Integer type) {
      this.eventMap = eventMap;
      this.firstTimestamp = firstTimestamp;
      this.type = type;
    }
  }
}

Exception stack is :

Caused by: org.apache.flink.table.api.ValidationException: Could not extract a data type from 'java.util.Set<java.lang.String>'. Interpreting it as a structured type was also not successful.

….

Caused by: org.apache.flink.table.api.ValidationException: Class 'java.util.Set' must not be abstract.
at org.apache.flink.table.types.extraction.ExtractionUtils.extractionError(ExtractionUtils.java:362) ~[flink-table-api-java-uber-1.16.1.jar:1.16.1]
at org.apache.flink.table.types.extraction.ExtractionUtils.extractionError(ExtractionUtils.java:357) ~[flink-table-api-java-uber-1.16.1.jar:1.16.1]

If I used ArrayList it works fine. Not really sure the difference on how the Flink decides if a HashSet has not fields as it fails to read it as a structure whereas with ArrayList it completely works fine. Can someone please suggest what is the right way here to implement this UDAF using HashSet and HashMap.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật