Repository navigation
Conversation
When parse_quotable_robust found a field longer than max_field_size, it skipped only to the end of the physical line. If a later quoted field in the record spanned lines, the rest of the record was parsed as the next row. Skip the rest of the record with parse_column_value, so the next row and CSV#line are correct. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
How about doing this in all parse modes like #382? |
Author
|
Closing in favor of #382. Thank you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After a
max_field_sizeerror, the field-scanning parser (parse_quotable_robust) skips only to the end of the physical line. If a later quoted field in the record spans lines, the rest of the record comes back as the next row:Without
liberal_parsing, the field-scanning parser is used after a row with a quoted field that spans lines. There, the rest of the record raisesIllegal quotingon the nextshift.Fix
parse_quotable_robustpasses a block tovalidate_field_size, which calls it in place ofignore_broken_line. The block calls the newignore_broken_record, which reads the remaining fields of the record withparse_column_valueand then the row end.CSV#lineis then the whole broken record, and the line number goes up by one. The line-splitting parser (parse_quotable_loose) andparse_no_quoteare unchanged.If the rest of the record is malformed,
ignore_broken_recorddrops the rest of the physical line, and the error is still the field size error. An unclosed quote after the long field now reads to the end of the input, as it does withoutmax_field_size. Onmain,abcde,"x\nc,d\nwithliberal_parsingreturned["c", "d"]after the error.