Avro adapter: setPosition doesn't work with BaseVariableWidthVectors
- Ngôn ngữ chính
- Java
- Star
- 94
- Fork
- 152
- Merge trung bình
- 3 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 11
Mô tả
### Describe the bug, including details regarding any error messages, version, and platform.
`BaseVariableWidthVector`-based vectors (`VarBinaryVector`, `VarCharVector`) expect the data to be written sequentially. This means `Consumer.setPosition` is not safe to use. Imagine the following scenario:
- write index 0
- write index 2
- write index 1
- write index 3
On the last step, `BaseVariableWidthVector.fillHoles` erases the data written for the index 2:
```java
protected final void fillHoles(int index) {
for (int i = lastSet + 1; i < index; i++) {
setBytes(i, emptyByteArray, 0, emptyByteArray.length);
}
lastSet = index - 1;
}
```
Here, index would be 3, lastSet + 1 would be 2 (1 + 1), so `setBytes(2, emptyByteArray, ...)` is called.
Not sure what the right solution is here, but at a minimum, the library shouldn't allow calling `setPosition` for Consumers using `BaseVariableWidthVector` vectors.
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách truy vết hành vi của Consumer.setPosition trong Avro adapter với các instance VarBinaryVector và VarCharVector dựa trên BaseVariableWidthVector. Tái hiện chuỗi ghi 0, 2, 1, 3 và thêm một regression test; được coi là hoàn tất khi việc định vị không còn xóa dữ liệu đã ghi trước đó hoặc bị ngăn chặn đối với các vector này.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java
- Lĩnh vực
- data
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 35/100