This is an automated email from the ASF dual-hosted git repository.
wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new 95d62ca ARROW-4834: [R] Feature flag when building parquet
95d62ca is described below
commit 95d62caff4c352dba848221454d55c21b8857448
Author: Javier Luraschi <[email protected]>
AuthorDate: Wed Mar 13 12:19:53 2019 -0500
ARROW-4834: [R] Feature flag when building parquet
Support `ARROW_R_PARQUET_OFF` build flag to disable Parquet for R builds.
Fix for: https://issues.apache.org/jira/browse/ARROW-4834
CC: @jeroen
Author: Javier Luraschi <[email protected]>
Closes #3870 from javierluraschi/bugfix/r-parquet-flag and squashes the
following commits:
732c58b0f <Javier Luraschi> use ARROW_R_WITH_PARQUET
340ee0f6a <Javier Luraschi> remove double-negation
1b727f542 <Javier Luraschi> Feature flag when building parquet
---
r/src/parquet.cpp | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/r/src/parquet.cpp b/r/src/parquet.cpp
index 859bd48..c9131cd 100644
--- a/r/src/parquet.cpp
+++ b/r/src/parquet.cpp
@@ -17,12 +17,16 @@
#include <arrow/api.h>
#include <arrow/io/api.h>
+#ifdef ARROW_R_WITH_PARQUET
#include <parquet/arrow/reader.h>
#include <parquet/arrow/writer.h>
#include <parquet/exception.h>
+#endif
+#include <RcppCommon.h>
// [[Rcpp::export]]
std::shared_ptr<arrow::Table> read_parquet_file(std::string filename) {
+#ifdef ARROW_R_WITH_PARQUET
std::shared_ptr<arrow::io::ReadableFile> infile;
PARQUET_THROW_NOT_OK(
arrow::io::ReadableFile::Open(filename, arrow::default_memory_pool(),
&infile));
@@ -34,4 +38,10 @@ std::shared_ptr<arrow::Table> read_parquet_file(std::string
filename) {
PARQUET_THROW_NOT_OK(reader->ReadTable(&table));
return table;
+#else
+ Rcpp::stop("Support for Parquet is not available.");
+
+ std::shared_ptr<arrow::Table> table;
+ return table;
+#endif
}