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] POJO serialization: Skipped fields still consume memory #2928
clientModule: the client (client-v2; with legacy: the v1 client)data-typesArea: type names, value encoding and decoding, row mapping, data formatsperformance
Method com.clickhouse.client.api.data_formats.internal.BinaryStreamReader#skipValue internally calls readValue and does complete read and object creation. This may be critical when many BigInteger fields are skipped but still consume memory.
Expected that next evolution of the reader will have option to read or skip bytes from stream entirely.
Recommendation: Keep open — fix needed
The run confirms that the reader fully decodes each skipped POJO column: skipping costs almost as much memory as reading. No open PR changes skipValue.
Status on main: Reproduced on main — 4 skipped UInt256 columns add about 460 bytes per row; 4 read columns add about 515.
Breaking change: No — BinaryStreamReader is in an internal package.
Duplicates / related: None found
Workaround: Select only the columns that the POJO maps (the first case of the run).
Analysis:Client.queryAll(sql, Class, schema) reads each row with readToPOJO (Client.java:2316), which calls skipValue for each column with no setter (AbstractBinaryFormatReader.java:133). skipValue (BinaryStreamReader.java:852-854) only calls readValue(column, null), so it decodes the value and creates its object (a BigInteger for UInt256) and then drops it.
clientModule: the client (client-v2; with legacy: the v1 client)data-typesArea: type names, value encoding and decoding, row mapping, data formatsperformance
Activity
polyglotAI-bot commentedon Nov 27, 2026
Recommendation: Keep open — fix needed
The run confirms that the reader fully decodes each skipped POJO column: skipping costs almost as much memory as reading. No open PR changes
skipValue.main: Reproduced on main — 4 skippedUInt256columns add about 460 bytes per row; 4 read columns add about 515.BinaryStreamReaderis in aninternalpackage.Analysis:
Client.queryAll(sql, Class, schema)reads each row withreadToPOJO(Client.java:2316), which callsskipValuefor each column with no setter (AbstractBinaryFormatReader.java:133).skipValue(BinaryStreamReader.java:852-854) only callsreadValue(column, null), so it decodes the value and creates its object (aBigIntegerforUInt256) and then drops it.Reproduction: complete program and output
Output on
main(8480ca001), ClickHouse 26.11.2.4:Automated triage by Polyglot AI. A maintainer makes the final decision.