Repository navigation
Description
Follow-up to the second point of the suggested fix in #571, which #575 leaves aside: validating the elements of a container, so that an unknown type name fails loudly instead of desynchronising the stream.
A type name the parser does not know becomes a Void terminal. At the root, ValidateAST rejects it and the client throws "unsupported column type". Inside a container nothing checks it: the column is created as ColumnNothing, which reads one byte per row, and the rest of the block is misread, with no error naming the type.
In the client itself, on master (fc5d98f):
CreateColumnByType("Int256"); // nullptr, the client reports "unsupported column type: Int256"
CreateColumnByType("Array(Int256)"); // a column typed Array(Void), no errorAgainst ClickHouse 26.11:
SELECT CAST(1, 'Int256') AS wide -- UnimplementedError: unsupported column type: Int256
SELECT [CAST(1, 'Int256')] AS wide -- without compression: one row, no exception, wrong content. With LZ4: some data was not readOther names a server sends as is and the parser does not know, checked with toTypeName on 26.11: Variant, Dynamic, BFloat16, UInt256, the Interval* types, LineString, MultiPoint, QBit, AggregateFunction. At the root each of them is an error. Inside an Array, what happens depends on the type and the compression: without compression Int256, UInt256, QBit, AggregateFunction and the Interval* types come back as wrong data with no exception, BFloat16, Variant, Dynamic, LineString and MultiPoint fail later with unrelated errors (unimplemented 63, unsupported custom serialization, unimplemented 8176), and with LZ4 every one of them fails with some data was not read. None of these errors names the type. Nothing goes through the same path and only works by accident, one byte per row on both sides, which SELECT [] and SELECT NULL rely on.
#578 handles the neighbouring case, a type the parser accepts but the factory cannot build inside a wrapper, which crashed. This one is about names the parser does not know at all, and the two change different functions.
#590 is a draft for it, stacked on #575 because it needs the Nested node from there. It validates the elements of those six containers, leaves the arguments of every other type alone (JSON settings and typed paths, the function name of SimpleAggregateFunction), and registers Nothing. An unknown name inside a container then makes CreateColumnByType return nullptr, so the client throws the same "unsupported column type" as at the root.
Would you rather have a diagnostic that names the inner type? The draft's tests would then expect it instead of nullptr.
Activity
[-]Unknown type names inside a container decode silently as wrong data[/-][+]Unknown type names inside a container are misread instead of rejected[/+]polyglotAI-bot commentedon Nov 17, 2026
Recommendation: Keep open — fix needed: review PR #575, then PR #590
PR #590 fixes all cases of the reproduction below. It is stacked on PR #575 (its first commit is the #575 commit), so #575 must merge first. With #590, the client error names the full column type (
unsupported column type: Array(Int256)), so the open question about a diagnostic that names the inner type is less important.master: Reproduced on master —58453c2, ClickHouse 26.10.4.207, default 2.x build options, program belownullptrandunsupported column type, as it already does at the root. No correct decode depends on the oldColumnNothingresult, andNothingstays accepted.Array(Nested(...)), the sameVoidterminal path; PR Create Nested(...) columns as Array(Tuple(...)) #575 addsNested). Related: Reject wrapper types built over unsupported nested types #578 (merged; a known type that the factory cannot build inside a wrapper).Analysis:
GetTypeCodereturnsType::Voidfor a name that is not inkTypeCode(clickhouse/types/type_parser.cpp:114-121).ValidateASTrejects such a terminal (type_parser.cpp:159-168), butTypeParser::Parsecalls it only on the root node (type_parser.cpp:251). InsideArray,NullableorMap, theVoidterminal goes toCreateTerminalColumn, which makes aColumnNothing(clickhouse/columns/factory.cpp:61-62).ColumnNothing::LoadBodyskips one byte per row (clickhouse/columns/nothing.h:61-62), so the client reads less than the server sent. Without compression, the query returns one row with no data and no error; when a column follows, the client reads the next type name from the wrong offset and fails withunsupported column type:(empty name). With LZ4, the client fails withsome data was not read.Reproduction: complete program and output
Output on
master(58453c2), ClickHouse 26.10.4.207:Output on
master(58453c2) with the diff of PR #590 applied, same server:Automated triage by Polyglot AI. Classification added on 2026-11-19. A maintainer makes the final decision.