[client-v2] NativeFormatReader fails for non-null values of Nullable(String)
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 74/100
Research direction
Start at the NativeFormatReader entry point and reproduce the issue with the provided Nullable(String) queries using client-v2 0.10.0 and ClickHouseFormat.Native. Trace the failing non-null read, then verify that non-null Nullable(String) values are read successfully without EOFException while the NULL query continues to work.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Java
- Stars
- 1.6k
- Forks
- 637
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 28
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ClickHouse/clickhouse-java
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ClickHouse/clickhouse-java#3143 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
ClickHouse/clickhouse-java#3111 ·
-
area:data-type bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ClickHouse/clickhouse-java#3098 · 1 comment ·
-
bug client-api-v2 test
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
ClickHouse/clickhouse-java#3076 ·
-
area:sql-parser bug client-v1
Difficulty 1/5 1-3 hours Newbie friendliness 92/100
ClickHouse/clickhouse-java#3066 ·
All issues in ClickHouse/clickhouse-java
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100