apache / apache/iotdb

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

オープン 初心者向け
#17,407 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
6.4k
フォーク
1.2k
平均マージ
1日 23時間
マージ済み PR(30日)
115

説明

### 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!

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

IoTDBRpcDataSet.java から開始し、影響を受ける6つの ByTsBlockColumnIndex getter メソッドを getLongByTsBlockColumnIndex および getStringByTsBlockColumnIndex と併せて調査します。ツリーモデルの時間列パスを確認し、利用可能であれば関連する Java クライアントテストを実行します。完了の条件は、列 -1 にアクセスする代わりに、列挙されたすべての non-long getter が明確な StatementExecutionException を報告することです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
databases
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
静か
明瞭さ
明確に書かれている
初心者へのやさしさ
72/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。