apache / apache/iotdb

Fix Java client time column access throwing ArrayIndexOutOfBoundsException for non-long typed getters

Đang mở Phù hợp với người mới
#17,407 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Java
Star
6.4k
Fork
1.2k
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
115

Mô tả

### Search before asking

- [x] I searched in the [issues](https://github.com/apache/iotdb/issues) and found nothing similar.

### Version

Master

### Describe the bug and provide the minimal reproduce step

In `IoTDBRpcDataSet.java`, several `ByTsBlockColumnIndex` getter methods do not handle the `tsBlockColumnIndex < 0` case (time pseudo-column in tree model). Only `getLongByTsBlockColumnIndex` and `getStringByTsBlockColumnIndex` correctly handle this case.

When tree model is used, column index 1 maps to `tsBlockColumnIndex = -1` (time column). Accessing it through typed getters other than `getLong` or `getString` causes `ArrayIndexOutOfBoundsException` from `TsBlock.getColumn(-1)`.

Affected methods:
- `getBooleanByTsBlockColumnIndex`
- `getIntByTsBlockColumnIndex`
- `getFloatByTsBlockColumnIndex`
- `getDoubleByTsBlockColumnIndex`
- `getBinaryByTsBlockColumnIndex`
- `getObjectByTsBlockColumnIndex`

This is the Java equivalent of the C++ client bug fixed in #17400.

### What did you expect to see?

A clear `StatementExecutionException` with message like "Cannot read boolean from time column" instead of an opaque `ArrayIndexOutOfBoundsException`.

### What did you see instead?

`ArrayIndexOutOfBoundsException` with index -1.

### Anything else?

_No response_

### Are you willing to submit a PR?

- [x] I'm willing to submit a PR!

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu trong IoTDBRpcDataSet.java và kiểm tra sáu phương thức getter ByTsBlockColumnIndex bị ảnh hưởng cùng với getLongByTsBlockColumnIndex và getStringByTsBlockColumnIndex. Xác minh đường dẫn cột thời gian của mô hình cây, sau đó chạy các bài kiểm thử Java client liên quan nếu có; được coi là hoàn tất khi tất cả các getter non-long được liệt kê đều báo cáo một StatementExecutionException rõ ràng thay vì truy cập cột -1.

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
databases
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
72/100

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.