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
* add fread connection support
* fix testnum
* make linterse happy
* make linters even more happy
* remove read bytes %d since this can overflow
* add coverage
* be fully experimental API compliant
* more coverage
* update error message for nrow and mmap
* add wording changes
Co-authored-by: aitap <krylov.r00t@gmail.com>
* add connections guard
Co-authored-by: aitap <krylov.r00t@gmail.com>
* add strerrors
Co-authored-by: aitap <krylov.r00t@gmail.com>
* add errno lib
* add reopen_connection generic
* close con on exit
* adjust doc
* update conncection info
* reopen connection
* change modes
* update docs
* add nocov
* use R_ExecWithCleanup to clean up on errors
* add test for consuming before fread
* use factory pattern
* add aliases for S3 methods
* capture print in test
* fix namespace
* rename to binary_reopener
* More #ifdef wrapping for connections API
Wrap the helper functions too. Avoid double negatives.
* R_FINITE will always be true for a size_t argument
* Fail when nrow_limit exceeds SIZE_MAX
Otherwise truncation occurs silently, possibly setting the limit to
something like 100.
* Use translateChar() for native encoding string
CHAR() could in theory return Latin-1 or UTF-8 text. translateChar()
checks the encoding bits and only converts if needed, releasing the
memory upon return from the .Call().
* update NEWS
* clean up merge
* more clean up merge
* move extra args
* update NEWS
* make linter happy
* Actually compile with R_CONNNECTIONS_VERSION != 1
* Rename Rd file to match \name{}
* Register methods for exported binary_reopener()
---------
Co-authored-by: aitap <krylov.r00t@gmail.com>
Copy file name to clipboardExpand all lines: NEWS.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,8 @@
44
44
45
45
6. By-reference sub-assignments of strings to factor columns now _actually_ match the levels in UTF-8 when required and now don't result in invalid factors being created, [#7648](https://github.com/Rdatatable/data.table/issues/7648), amending a previous incomplete fix to [#6886](https://github.com/Rdatatable/data.table/issues/6886) in v1.17.2. Thanks @BASS-JN for the report and @aitap for the fix.
46
46
47
+
7.`fread()` can now read from connections directly by spilling to a temporary file first, [#561](https://github.com/Rdatatable/data.table/issues/561). For the best throughput, point `tmpdir=` (or the global temp directory) to fast storage like an SSD or RAM. Thanks to Chris Neff for the report and @ben-schwen for the implementation.
48
+
47
49
### Notes
48
50
49
51
1. {data.table} now depends on R 3.5.0 (2018).
@@ -377,7 +379,8 @@ See [#2611](https://github.com/Rdatatable/data.table/issues/2611) for details. T
377
379
# user system elapsed
378
380
# 0.028 0.000 0.005
379
381
```
380
-
20.`fread()`nowsupportsthe`comment.char`argumenttoskiptrailingcommentsorcomment-onlylines, consistentwith`read.table()`, [#856](https://github.com/Rdatatable/data.table/issues/856). The default remains `comment.char = ""` (no comment parsing) for backward compatibility and performance, in contrast to `read.table(comment.char = "#")`. Thanks to @arunsrinivasan and many others for the suggestion and @ben-schwen for the implementation.
382
+
383
+
20.`fread()`nowsupportsthe`comment.char`argumenttoskiptrailingcommentsorcomment-onlylines, consistentwith`read.table()`, [#856](https://github.com/Rdatatable/data.table/issues/856). The default remains `comment.char = ""` (no comment parsing) for backward compatibility and performance, in contrast to `read.table(comment.char = "#")`. Thanks to @arunsrinivasan and many others for the suggestion and @ben-schwen for the implementation.
if (!input_is_con&& is.null(cmd) && is.null(text)) {
59
104
if (!is.character(input) || length(input)!=1L) {
60
105
stopf("input= must be a single character string containing a file name, a system command containing at least one space, a URL starting 'http[s]://', 'ftp[s]://' or 'file://', or, the input data itself containing at least one \\n or \\r")
Copy file name to clipboardExpand all lines: src/fread.c
+13-3Lines changed: 13 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1576,9 +1576,16 @@ int freadMain(freadMainArgs _args)
1576
1576
CloseHandle(hFile); // see https://msdn.microsoft.com/en-us/library/windows/desktop/aa366537(v=vs.85).aspx
1577
1577
if (mmp==NULL) {
1578
1578
#endif
1579
-
intnbit=8*sizeof(char*); // #nocov
1580
-
STOP(_("Opened %s file ok but could not memory map it. This is a %dbit process. %s."), filesize_to_str(fileSize), nbit, // # nocov
1581
-
nbit <= 32 ? _("Please upgrade to 64bit") : _("There is probably not enough contiguous virtual memory available")); // # nocov
1579
+
// # nocov start
1580
+
intnbit=8*sizeof(char*);
1581
+
if (nrowLimit<INT64_MAX) {
1582
+
STOP(_("Opened %s file ok but could not memory map it. This is a %dbit process. Since you specified nrows=%"PRId64", try wrapping the file in a connection: fread(file('filename'), nrows=%"PRId64")."),
0 commit comments