Open sjoubert opened 9 months ago
I'll see what I can do. I appreciate the example patch you've provided.
I didn't expect people to try to use this library on embedded devices (where ITERATION_CHUNK_SIZE
is too large) nor did I expect people to try to parse CSVs where there are single rows that that up more space than ITERATION_CHUNK_SIZE
.
If a line is longer than
ITERATION_CHUNK_SIZE
(corner case, but unfortunately large dataset happen in the wild),CSVReader::read_row
will loop forever, spawningread_csv
thread infinitely.For now I've patched this using:
This avoids spawning a new thread if the previous one was unsuccessful (here because the line is too long for the chunk and can't be parsed).
It looks like this should be handle better/elsewhere. But for now this seems to work for me.