Skip to content

Commit

Permalink
ARROW-14653: [R] head() hangs on CSV datasets > 600MB
Browse files Browse the repository at this point in the history
This PR switches to using the asynchronous scanner by default when reading in datasets.  I've tested it locally on a large dataset (2.5Gb of CSV files) and it does resolve the original issue, but due to the size of the files involved I wasn't sure this was something I could easily write tests for.

Closes #11992 from thisisnic/ARROW-14653_head_hangs

Authored-by: Nic Crane <thisisnic@gmail.com>
Signed-off-by: Nic Crane <thisisnic@gmail.com>
  • Loading branch information
thisisnic committed Jan 3, 2022
1 parent cb1897e commit 762fad5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions r/NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* Added `decimal128()` (~~identical to `decimal()`~~) as the name is more explicit and updated docs to encourage its use.
* Source builds now by default use `pkg-config` to search for system dependencies (such as `libz`) and link to them
if present. To retain the previous behaviour of downloading and building all dependencies, set `ARROW_DEPENDENCY_SOURCE=BUNDLED`.
* Opening datasets now use async scanner by default which resolves a deadlock issues related to reading in large multi-CSV datasets

# arrow 6.0.1

Expand Down
4 changes: 2 additions & 2 deletions r/R/dataset-scan.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#' to keep all rows.
#' * `use_threads`: logical: should scanning use multithreading? Default `TRUE`
#' * `use_async`: logical: should the async scanner (performs better on
#' high-latency/highly parallel filesystems like S3) be used? Default `FALSE`
#' high-latency/highly parallel filesystems like S3) be used? Default `TRUE`
#' * `...`: Additional arguments, currently ignored
#' @section Methods:
#' `ScannerBuilder` has the following methods:
Expand Down Expand Up @@ -73,7 +73,7 @@ Scanner$create <- function(dataset,
projection = NULL,
filter = TRUE,
use_threads = option_use_threads(),
use_async = getOption("arrow.use_async", FALSE),
use_async = getOption("arrow.use_async", TRUE),
batch_size = NULL,
fragment_scan_options = NULL,
...) {
Expand Down
2 changes: 1 addition & 1 deletion r/man/Scanner.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 762fad5

Please sign in to comment.