I am using client-v2 0.10.0 with ClickHouseFormat.Native.
Given a table:
CREATE TABLE test_table
(
id String,
optionalValue Nullable(String)
)
ENGINE = MergeTree
ORDER BY id;
Working query
This works:
SELECT optionalValue
FROM test_table
WHERE optionalValue IS NULL;
Failing query
This fails:
SELECT optionalValue
FROM test_table
WHERE optionalValue IS NOT NULL;
with:
ClientException: Failed to read block
Caused by: EOFException: End of stream reached before reading all data
at NativeFormatReader.readBlock(...)
Workaround
Casting the column to String works:
SELECT CAST(optionalValue AS String) AS optionalValue
FROM test_table;
Java code
QuerySettings settings =
new QuerySettings().setFormat(ClickHouseFormat.Native);
try (QueryResponse response =
client.query(sqlQuery, settings).get()) {
NativeFormatReader reader =
(NativeFormatReader) client.newBinaryFormatReader(response);
}
Environment
client-v2: 0.10.0
- ClickHouse server:
25.9.3.48
- Java:
21
I am using
client-v2 0.10.0withClickHouseFormat.Native.Given a table:
Working query
This works:
Failing query
This fails:
with:
Workaround
Casting the column to
Stringworks:Java code
Environment
client-v2:0.10.025.9.3.4821