Fix Java client time column access throwing ArrayIndexOutOfBoundsException for non-long typed getters
- Lenguaje dominante
- Java
- Estrellas
- 6.4k
- Forks
- 1.2k
- Merge medio
- 1 d 23 h
- PR fusionados (30 d)
- 115
Descripción
### 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!
Guía de contribución
Línea de trabajo
Comienza en IoTDBRpcDataSet.java e inspecciona los seis métodos getter ByTsBlockColumnIndex afectados junto con getLongByTsBlockColumnIndex y getStringByTsBlockColumnIndex. Verifica la ruta de la columna de tiempo del modelo de árbol y, después, ejecuta las pruebas relevantes del cliente Java si están disponibles; se considera terminado cuando todos los getters que no son long enumerados informan de una StatementExecutionException clara en lugar de acceder a la columna -1.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java
- Área
- databases
- Tipo de issue
- Error
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Tranquilo
- Claridad
- Bien especificado
- Aptitud para principiantes
- 72/100