[Bug] range-bitmap file index: IS NULL returns only the first and last row when a column is entirely NULL in a file
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ó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 88/100
Hướng nghiên cứu
Bắt đầu tại org.apache.paimon.fileindex.rangebitmap.RangeBitmap#isNull và kiểm tra nhánh cardinality <= 0. Chạy bản tái hiện Java API được cung cấp với năm giá trị hoàn toàn là NULL; hoàn thành khi c IS NULL trả về cả năm hàng, kèm theo độ bao phủ hồi quy cho trường hợp range-bitmap.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Search before asking
- I searched in the issues and found nothing similar.
Paimon version
2.0.0 (paimon-bundle-2.0.0)
Compute Engine
None — reproduced with the Java API (ReadBuilder.withFilter), local filesystem catalog, Java 21.
Minimal reproduce step
Create an append table with a range-bitmap file index on c, write 5 rows where c is NULL in every row, then read with c IS NULL:
Identifier id = Identifier.create("db", "t_isnull");
catalog.createTable(
id,
Schema.newBuilder()
.column("id", DataTypes.INT())
.column("c", DataTypes.INT())
.option("file-index.range-bitmap.columns", "c")
.build(),
false);
Table table = catalog.getTable(id);
List<GenericRow> rows = new ArrayList<>();
for (int i = 0; i < 5; i++) {
rows.add(GenericRow.of(i, null));
}
write(table, rows);
Predicate isNull = new PredicateBuilder(table.rowType()).isNull(1);
System.out.println(count(table, isNull)); // prints 2
System.out.println(count(table, null)); // prints 5
Helper methods:
static void write(Table table, List<GenericRow> rows) throws Exception {
BatchWriteBuilder builder = table.newBatchWriteBuilder();
try (BatchTableWrite write = builder.newWrite();
BatchTableCommit commit = builder.newCommit()) {
for (GenericRow row : rows) write.write(row);
commit.commit(write.prepareCommit());
}
}
static long count(Table table, Predicate filter) throws Exception {
ReadBuilder builder = table.newReadBuilder();
if (filter != null) builder = builder.withFilter(filter);
long[] count = new long[1];
try (RecordReader<InternalRow> reader =
builder.newRead().createReader(builder.newScan().plan())) {
reader.forEachRemaining(row -> count[0]++);
}
return count[0];
}
The same table with file-index.bitmap.columns or file-index.bsi.columns instead of range-bitmap returns 5.
What doesn't meet your expectations?
c IS NULL returns 2 rows; all 5 rows match. The rows returned are the first and the last row of the file; every row in between is dropped.
The same table with file-index.bitmap.columns or file-index.bsi.columns instead of range-bitmap returns 5.
Anything else?
Root cause is in org.apache.paimon.fileindex.rangebitmap.RangeBitmap#isNull. When the column has no non-null value in the file (cardinality <= 0), it returns:
RoaringBitmap32.bitmapOf(0, rid - 1)
bitmapOf(int...) takes a list of positions, so this is the two-element set {0, rid - 1}, not the range [0, rid). Any file with three or more rows where the indexed column is entirely NULL loses its middle rows for IS NULL.
Suggested fix: return the full range, e.g. RoaringBitmap32.bitmapOfRange(0, rid). isNotNull on the same reader is correct (it returns an empty bitmap for such a file), so the complement of isNotNull over [0, rid) gives the right answer too.
Are you willing to submit a PR?
- I'm willing to submit a PR!
- Ngôn ngữ chính
- Java
- Star
- 3.4k
- Fork
- 1.4k
- Merge trung bình
- 1 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 469
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/paimon
-
[Bug] Flink VARIANT NOT NULL column is stored as nullableCó thể đã có người làm @LuciferYang đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] [Hive] IndexOutOfBoundsException when converting an unavailable dynamic BETWEEN predicateCó thể làm lại được @zhang-arvin đã nhận 48 ngày trước và không có pull request nào đang mở. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
apache/paimon#9440 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] Hive query on Paimon table fails with 'Proxy user is not supported' when Kerberos proxy user is usedCó thể đã có người làm @sohurdc đã nhận 58 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/paimon#9006 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] FileIndexFormat.Reader leaks input stream when construction fails with a runtime exceptionCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của apache/paimon
Issue tương tự
-
NullPointerException when a `DeserializationProblemHandler` returns `null` for `byte[]` (single value unwrapped) and `char[]` elementsCó thể đã có người làm @Marti2203 đã nhận hôm nay. Đang mở
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 88/100
FasterXML/jackson-databind#6300 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
content good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
cpinitiative/usaco-guide#6699 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
BC remittance upload: a claim MSP refused (S03) is saved with a blank status instead of refused (F)Đang mởtype: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
carlos-emr/carlos#4933 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
apache/rocketmq-dashboard#6925 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Vakore/ZappierGames#147 ·