Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Bug] Precise union drops repeated keys in the SortShuffle path

Đang mở
#3,397 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
75/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
databases

Hướng nghiên cứu

Read UnionFilterIterator.java, especially NoRepeatValueIterator.hasNext() and saveElement(), then trace how the reducer handles comparator-equal groups and EOF. Reproduce with 20,000 keys occurring twice and check behavior across flush boundaries and repeated probes. Done means each matching name group emits one representative while preserving the intended representative/value rule.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug
Bug Type

Logic / missing results in precise union queries.

Environment

Development source reviewed in PR #3395, Java 17. Reproduced with the production iterators and SortShuffle in a standalone JVM; no running Store cluster was used.

Expected and actual behavior

Once UnionFilterIterator has more than 10,000 map entries, it selects the SortShuffle/reducer path. NoRepeatValueIterator omits an entire comparator-equal group when that group occurs more than once, rather than returning one representative.

A probe with 20,000 keys, each read twice returns 0 rows; expected 20,000 rows, one per key. Each occurrence is a newly allocated BackendColumn with identical name/value bytes for that key.

The same query shape should retain each overlapping key once. MapUnionIterator already does so on the alternate small-query path.

Reproduction
  1. Generate keys as four-byte integer arrays and two occurrences per key, with fresh BackendColumn objects and arrays for every row.
  2. Populate an IntersectionWrapper from the first pass and call proc(); all keys in this dataset are repeated candidates.
  3. Construct UnionFilterIterator over an independent second pass, using the production BackendColumn serializer and name comparator.
  4. Consume normally with while (iterator.hasNext()) { iterator.next(); count++; }. The observed count is zero.

The 10,000 threshold selects the union's sorting branch. SortShuffle has its own higher physical-file threshold, so this defect can occur before it writes an actual spill file; its file-backed path uses the same reducer.

Cause and focused follow-up

saveElement() preserves repeated candidates for sorting, but NoRepeatValueIterator.hasNext() skips groups where its duplicate counter is positive, including the final group. Fix reduction to emit a representative once for each matching name group, and cover repeated keys across flush boundaries, repeated probes, and EOF. Preserve the intended representative/value rule.

Sources: UnionFilterIterator and reducer, MapUnion alternate query path.

This is independent of the in-memory map-key defect tracked in https://github.com/apache/hugegraph/issues/3396 and predates the changed iterator-state logic in PR #3395. Keep it as a separate correctness fix rather than expanding that PR.

Issue search performed for NoRepeatValueIterator and UnionFilterIterator; no matching existing issue was found.

Ngôn ngữ chính
Java
Star
3.2k
Fork
642
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
100

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/hugegraph

Tất cả issue của apache/hugegraph

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.