Skip to content

[CSV-327] Limit parser maxRows by produced records#607

Open
OldTruckDriver wants to merge 1 commit into
apache:masterfrom
OldTruckDriver:fix/csvparser-maxrows-record-number-offset
Open

[CSV-327] Limit parser maxRows by produced records#607
OldTruckDriver wants to merge 1 commit into
apache:masterfrom
OldTruckDriver:fix/csvparser-maxrows-record-number-offset

Conversation

@OldTruckDriver

Copy link
Copy Markdown

Fixes CSV-327.

CSVParser used the next assigned record number to decide whether maxRows allowed another row. When parsing resumes with CSVParser.Builder#setRecordNumber(...), this can make a parser with maxRows return no records before it has produced any rows.

This changes the iterator to track how many records it has produced and applies maxRows to that count instead of the assigned record number.

Tests:

  • mvn -q test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant