private ClickHouseRecord nextRecord() throws NoSuchElementException, UncheckedIOException {
        final DefaultSerDe s = getInitializedSerDe();
        final ClickHouseRecord r = config.isReuseValueWrapper() ? s.currentRecord : s.currentRecord.copy();
        try {
            readAndFill(r);
        } catch (StreamCorruptedException e) {
            byte[] search = "ode: ".getBytes(StandardCharsets.US_ASCII);
            byte[] bytes = input.getBuffer().array();
            int index = ClickHouseByteUtils.indexOf(bytes, search);
            if (index > 0 && bytes[--index] == (byte) 'C') {
                throw new UncheckedIOException(new String(bytes, index, bytes.length - index, StandardCharsets.UTF_8),
                        e);
            } else {
                throw new UncheckedIOException(
                        ClickHouseUtils.format(ERROR_FAILED_TO_READ, readPosition + 1, s.columns.length,
                                s.columns[readPosition]),
                        e);
            }
        } catch (EOFException e) {
            if (readPosition == 0) { // end of the stream, which is fine
                throw new NoSuchElementException("No more record");
            } else {
                throw new UncheckedIOException(ClickHouseUtils.format(ERROR_REACHED_END_OF_STREAM,
                        readPosition + 1, s.columns.length, s.columns[readPosition]), e);
            }
        } catch (IOException e) {
            throw new UncheckedIOException(
                    ClickHouseUtils.format(ERROR_FAILED_TO_READ, readPosition + 1, s.columns.length,
                            s.columns[readPosition]),
                    e);
        }
        return r;
    }
This method calls {@link #readAndFill(ClickHouseRecord)} and resets
{@code readPosition} to zero(first column).

@return non-null record
@throws NoSuchElementException when no more record to read
@throws UncheckedIOException   when failed to read data from input stream
clickhouse-data/src/main/java/com/clickhouse/data/ClickHouseDataProcessor.java