You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[client-v2,jdbc-v2] Reading Array(Nullable(String)) with BinaryString enabled #2953
Nullable array strings wrong
High Severity
It looks like readArray is using the top-level readValue for nullable array elements when binaryStringSupport is enabled. This means nested String/FixedString inside Array(Nullable(...)) are read as StringValue instead of plain String. This goes against our rule for container types and could lead to ArrayStoreException or unexpected type mismatches.
Test data: Array(Nullable(String)), Array(Array(Nullable(String))), Array(Nullable(FixedString(3))), Array(String), Map(String, Nullable(String)), Tuple(Nullable(String), String). The rows have NULLs, empty arrays, and non-UTF-8 bytes. Result with binary_string_support=true:
Top-level String column (check that the flag is on)
client-v2 StringValue
-
With the flag off, the results are the same, but the top-level String column is a String. No StringValue is inside an array, map, or tuple. No exception occurs.
These tests pass on main: DataTypeTests#testReadArrayOfNullableStringWithBinaryStringSupport, JdbcDataTypeTests#testReadArraysOfNullableTypes, and BinaryStreamReaderTests (added in #3343). They cover Array(Nullable(String)). They do not cover Array(Nullable(FixedString(N))) or Array(Array(Nullable(String))). I can add tests for these two types if you want.
Separate finding (not part of this claim): on main, getStringArray() on a non-empty Array(Nullable(String)) throws ClientException: Not an array of strings, with the flag on and off. An empty array of the same column returns String[0]. I will examine it separately.
From my side, this issue can be closed.
Method: a devbox with a new server, and a temporary Java program that reads through client-v2 queryAll() and the jdbc-v2 driver. The 0.11.1 run used the same program with the release jars from Maven Central.
Activity
chernser commentedon Sep 29, 2026
@polyglotAI-bot verify it is working on main.
polyglotAI-bot commentedon Nov 19, 2026
Verified on
mainat 7506301 (client-v2 and jdbc-v2) with ClickHouse 26.10.4.207. The claim is not true onmain. It was true in release 0.11.1.Array(Nullable(T))are read withreadNestedValue()(stringAsBytes = false), so they stayString.readValue(). Git history shows fix: ensure nullable binary arrays return boxed type arrays instead of Object[] #2920 in releases 0.10.0 to 0.11.1. With 0.11.1 andbinary_string_support=true, the read of['first', NULL, 'last']::Array(Nullable(String))fails:IllegalArgumentException: Failed to set value at index: 0 value first of class ...StringValue when array type is class [Ljava.lang.String;(cause:array element type mismatch).Test data:
Array(Nullable(String)),Array(Array(Nullable(String))),Array(Nullable(FixedString(3))),Array(String),Map(String, Nullable(String)),Tuple(Nullable(String), String). The rows have NULLs, empty arrays, and non-UTF-8 bytes. Result withbinary_string_support=true:maingetList(),getObjectArray(),getObject()Stringornull, at all levelsqueryAll()fails (error above)getArray().getArray(),getObject()String[],String[][]Stringcolumn (check that the flag is on)StringValueWith the flag off, the results are the same, but the top-level
Stringcolumn is aString. NoStringValueis inside an array, map, or tuple. No exception occurs.These tests pass on
main:DataTypeTests#testReadArrayOfNullableStringWithBinaryStringSupport,JdbcDataTypeTests#testReadArraysOfNullableTypes, andBinaryStreamReaderTests(added in #3343). They coverArray(Nullable(String)). They do not coverArray(Nullable(FixedString(N)))orArray(Array(Nullable(String))). I can add tests for these two types if you want.Separate finding (not part of this claim): on
main,getStringArray()on a non-emptyArray(Nullable(String))throwsClientException: Not an array of strings, with the flag on and off. An empty array of the same column returnsString[0]. I will examine it separately.From my side, this issue can be closed.
Method: a devbox with a new server, and a temporary Java program that reads through client-v2
queryAll()and the jdbc-v2 driver. The 0.11.1 run used the same program with the release jars from Maven Central.