Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARROW-14025: [R][C++] PreBuffer is not enabled when scanning parquet via exec nodes #11386

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion r/R/dataset-format.R
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ CsvFragmentScanOptions$create <- function(...,
ParquetFragmentScanOptions <- R6Class("ParquetFragmentScanOptions", inherit = FragmentScanOptions)
ParquetFragmentScanOptions$create <- function(use_buffered_stream = FALSE,
buffer_size = 8196,
pre_buffer = FALSE) {
pre_buffer = TRUE) {
dataset___ParquetFragmentScanOptions__Make(use_buffered_stream, buffer_size, pre_buffer)
}

Expand Down
4 changes: 4 additions & 0 deletions r/src/dataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,10 @@ dataset___ParquetFragmentScanOptions__Make(bool use_buffered_stream, int64_t buf
}
options->reader_properties->set_buffer_size(buffer_size);
options->arrow_reader_properties->set_pre_buffer(pre_buffer);
if (pre_buffer) {
options->arrow_reader_properties->set_cache_options(
arrow::io::CacheOptions::LazyDefaults());
}
return options;
}

Expand Down
11 changes: 11 additions & 0 deletions r/tests/testthat/test-dataset-csv.R
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ test_that("CSV scan options", {
chr = c("foo", NA),
chr2 = c("bar", "baz")
))
expect_equal(
ds %>%
group_by(chr2) %>%
summarize(na = all(is.na(chr))) %>%
arrange(chr2) %>%
collect(),
tibble(
chr2 = c("bar", "baz"),
na = c(FALSE, TRUE)
)
)
})

test_that("compressed CSV dataset", {
Expand Down