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] Review hasNext() logic in com.clickhouse.client.api.data_formats.internal.AbstractBinaryFormatReader #3365
Methods like com.clickhouse.client.api.data_formats.internal.AbstractBinaryFormatReader#hasNext should be idempotent.
Beside current readers may do too complex logic of checking end of stream
make all reader idempotent method - idempotent
add tests reading enough data from DB to verify work of the reader
make sure no extra work is done for next operation.
Update:
Two failing tests:
[ERROR] Failures:
[ERROR] NativeFormatReaderDataSetTest>AbstractAccessorDataSetTest.testReadDataSet:118->AbstractBinaryReaderDataSetTest.readAndVerify:81 More rows than in the data set: 12 expected [true] but found [false]
[ERROR] NativeFormatReaderDataSetTest>AbstractAccessorDataSetTest.testReadDataSet:118->AbstractBinaryReaderDataSetTest.readAndVerify:81 More rows than in the data set: 17 expected [true] but found [false]
PR #3367 fixes the Native reader part of this issue. The two NativeFormatReaderDataSetTest failures had this cause: the reader decodes Array(Array(Int8)) and Map(String, Array(Nullable(Float64))) with the RowBinary layout, so it loses its position in the stream. It then read the leftover bytes as a block with 0 columns and N rows, and returned those rows. The reader now checks each block against the header of the first block. It sets the schema once and uses one method for hasNext() / readRecord(...). The Javadoc explains how the reader works. The PR does not change the other readers.
Activity
chernser commentedon Nov 17, 2026
@polyglotAI-bot
take this issue and first of all fix the issues with NativeFormat. Add enough docs to code to explain how it work.
polyglotAI-bot commentedon Nov 17, 2026
PR #3367 fixes the Native reader part of this issue. The two
NativeFormatReaderDataSetTestfailures had this cause: the reader decodesArray(Array(Int8))andMap(String, Array(Nullable(Float64)))with the RowBinary layout, so it loses its position in the stream. It then read the leftover bytes as a block with 0 columns and N rows, and returned those rows. The reader now checks each block against the header of the first block. It sets the schema once and uses one method forhasNext()/readRecord(...). The Javadoc explains how the reader works. The PR does not change the other readers.