You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Neal Richardson (Jira)" <ji...@apache.org> on 2021/10/04 18:26:00 UTC
[jira] [Commented] (ARROW-14025) [R][C++] PreBuffer is not enabled
when scanning parquet via exec nodes
[ https://issues.apache.org/jira/browse/ARROW-14025?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17424096#comment-17424096 ]
Neal Richardson commented on ARROW-14025:
-----------------------------------------
[~westonpace] is this the right idea (+/- whatever it takes to get it to compile)? I believe this means we also would be getting whatever FragmentScanOptions the dataset was created with (so that we could correctly query CSVs etc.).
{code}
diff --git a/r/src/compute-exec.cpp b/r/src/compute-exec.cpp
index c61f7a3d1..5c60f2ac2 100644
--- a/r/src/compute-exec.cpp
+++ b/r/src/compute-exec.cpp
@@ -113,7 +113,17 @@ std::shared_ptr<compute::ExecNode> ExecNode_Scan(
arrow::dataset::internal::Initialize();
// TODO: pass in FragmentScanOptions
- auto options = std::make_shared<arrow::dataset::ScanOptions>();
+ if (dataset->type_name() == "filesystem") {
+ // HALP: dataset is Dataset but needs to be cast to FileSystemDataset
+ // to have format() method
+ auto fmt = dataset->format();
+ auto options = fmt->default_fragment_scan_options;
+ if (fmt->type_name() == "parquet") {
+ options->arrow_reader_properties.pre_buffer_ = true;
+ }
+ } else {
+ auto options = std::make_shared<arrow::dataset::ScanOptions>();
+ }
options->use_async = true;
options->use_threads = arrow::r::GetBoolOption("arrow.use_threads", true);
{code}
> [R][C++] PreBuffer is not enabled when scanning parquet via exec nodes
> ----------------------------------------------------------------------
>
> Key: ARROW-14025
> URL: https://issues.apache.org/jira/browse/ARROW-14025
> Project: Apache Arrow
> Issue Type: Improvement
> Components: C++, R
> Reporter: Weston Pace
> Assignee: Neal Richardson
> Priority: Major
> Fix For: 6.0.0
>
>
> In ExecNode_Scan a ScanOptions object is built up. If we are reading parquet we should enable pre-buffering. This is done by creating a ParquetFragmentScanOptions object and enabling pre-buffering.
> Alternatively, we could just default pre-buffering to true for asynchronous scans of parquet data.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)