Conversation
Codecov Report
@@ Coverage Diff @@
## master #2800 +/- ##
==========================================
- Coverage 93.49% 93.48% -0.01%
==========================================
Files 61 61
Lines 12367 12364 -3
==========================================
- Hits 11562 11558 -4
- Misses 805 806 +1
Continue to review full report at Codecov.
|
mattdowle
approved these changes
Apr 28, 2018
Member
mattdowle
left a comment
There was a problem hiding this comment.
Yep, completely agree. Great.
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.
I tested that this fix allows fread to correctly parse the jigsaw-toxic-comments and avito-demand-prediction kaggle datasets.
The bug is resolved by removing the safeguard that would stop reading a field after encountering 100 newlines inside it. This safeguards breaks those use cases where the used does have a dataset with fields containing many newlines (eg. emails, extended descriptions, user comments on the web, etc.)
At first I thought of merely raising the limit higher -- say, to 10000. But that would merely make fread fail less often, but wouldn't eliminate the problem altogether. I also thought of making it an fread option exposed to the user. That would have added more complexity (such as throwing an exception suggesting the user to increase that newline limit), and then the first thing the user would probably do is to increase that limit anyways. So in the end that increased complexity would have served no purpose whatsoever...
The reason why the limit was there in the first place was so that if the user didn't quote their fields correctly, and there was just a single quote in the whole huge file, we didn't want to spend time reading the entire file before trying a more liberal QR. But I feel reading a well-formed CSV file correctly is much more important than the possibility of wasting some time when reading an ill-formed CSV... Because in reality there is no limit on how many newlines you may have in a text field. It could be a billion (although once a single field reaches in size 2^31 bytes, everything will break anyways :).
Closes #2395
Closes #2600