You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fwrite crashes for tables with large columns #2974
fwrite first attempt to compute max line length from a sample. By default, buffer is 8MB. Here line is 30M. In this PR #3288, I use strlen and a message error indicates that buffer is too small and give an advice to increase it.
> library(data.table)
> huge_vector <- paste(rep('x', 30e6), collapse='')
> foo <- data.table::data.table(x=factor(huge_vector))
> tf <- tempfile()
>
> # this reliably crashes my R session
> data.table::fwrite(foo, file=tf)
Error in data.table::fwrite(foo, file = tf) :
Error : max line length is greater than buffer secure limit. Try to increase buffMB option. Example 'buffMB = 58'
# OK
> data.table::fwrite(foo, file=tf, buffMB=58)
Awesome PR @philippechataignon! I made a few minor changes to PR #3288 and now this example works without needing user to increase buffMB. The test is not huge really, but to keep resources to a minimum on CRAN I haven't added it to the test suite.
Activity
philippechataignon commentedon Jan 16, 2019
fwritefirst attempt to compute max line length from a sample. By default, buffer is 8MB. Here line is 30M. In this PR #3288, I use strlen and a message error indicates that buffer is too small and give an advice to increase it.mattdowle commentedon Apr 23, 2019
Awesome PR @philippechataignon! I made a few minor changes to PR #3288 and now this example works without needing user to increase
buffMB. The test is not huge really, but to keep resources to a minimum on CRAN I haven't added it to the test suite.