-
Notifications
You must be signed in to change notification settings - Fork 614
Closed
Labels
Description
Describe the bug
ClickHouseRowMetadata is starting the index at 1, but the index should be starting at 0, according to the spec.
Expected behaviour
Should work according to spec. Index should start at 0.
Code example
for (int i = 0; i < rowMetadata.getColumnMetadatas().size(); i++) {
String name = rowMetadata.getColumnMetadata(i).getName(); // failing at 0.. i + 1 works
Object value = row.get(i); // works fine
map.put(name, value);
}Error log
java.lang.IllegalArgumentException: -1
at java.util.stream.ReferencePipeline.skip(ReferencePipeline.java:575) ~[?:?]
at com.clickhouse.r2dbc.ClickHouseRowMetadata.getColumnMetadata(ClickHouseRowMetadata.java:24) ~[clickhouse-r2dbc-0.4.6.jar:clickhouse-r2dbc 0.4.6 (revision: dd91e17)]
...
Configuration
Environment
- clickhouse-jdbc version: 0.4.6
zhicwu and KevinGuancheDarias