Commit a677ff0
authored
Fix use of limit in multithreaded parsing (#964)
* Fix use of limit in multithreaded parsing
Fixes #963. The issue here is that although we were adjusting the # of
rows to a provided limit when multithreaded parsing, we failed to adjust
the actual column arrays to the correct size. This was an issue when we
converted from the old `CSV.Column` custom array type to returning
"normal" arrays in the 0.7 -> 0.8 transition. With `CSV.Column`, we just
passed the final row total and it adjusted the size dynamically, without
physically resizing the underlying array. With regular arrays, however,
we need to ensure the array gets resized appropriately. This became more
apparent in the recent pooling change that was released since it
actually became a silenced BoundsError because of the use of `@inbounds`
in the new `checkpooled!` routine. I've taken out those `@inbounds` uses
for now to be more conservative. The fix is fairly straightforward in
that if we adjust our final row down to a user-provided limit, then we
loop over the parsing tasks and "accumulate" rows until we hit the limit
and then resize or `empty!` columns as appropriate.
* Fix1 parent 1061e24 commit a677ff0
2 files changed
+32
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
246 | 267 | | |
247 | 268 | | |
248 | 269 | | |
| |||
465 | 486 | | |
466 | 487 | | |
467 | 488 | | |
468 | | - | |
| 489 | + | |
469 | 490 | | |
470 | 491 | | |
471 | 492 | | |
472 | 493 | | |
473 | | - | |
| 494 | + | |
474 | 495 | | |
475 | 496 | | |
476 | 497 | | |
477 | 498 | | |
478 | 499 | | |
479 | 500 | | |
480 | | - | |
| 501 | + | |
481 | 502 | | |
482 | 503 | | |
483 | 504 | | |
484 | 505 | | |
485 | | - | |
| 506 | + | |
486 | 507 | | |
487 | | - | |
| 508 | + | |
488 | 509 | | |
489 | 510 | | |
490 | 511 | | |
491 | | - | |
| 512 | + | |
492 | 513 | | |
493 | 514 | | |
494 | | - | |
| 515 | + | |
495 | 516 | | |
496 | 517 | | |
497 | 518 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
769 | 769 | | |
770 | 770 | | |
771 | 771 | | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
772 | 776 | | |
0 commit comments