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
{{ message }}
Repository navigation
[R] Allow Parquet and Arrow Dataset to be optional components #27592
(along with some boost endian header deprecation warnings)
We could debug/patch that, or we could also make Parquet an optional feature in the R bindings. That might have some value anyway so that one could build a lighter/minimal R package, if that were helpful.
Neal Richardson / @nealrichardson:
See r/data-raw/codegen.R for how this comes together (docs in comments at the top of the file), and look at the bottom of r/src/filesystem.cpp for an example of how this is working for s3. Changes to make:
Make sure that everything that touches things in the parquet C++ namespace (C++ classes that are parquet::something, header #include statements of parquet paths) are inside #if defined(ARROW_R_WITH_PARQUET)
Change the // [[arrow::export]] annotations on those functions to be // [[parquet::export]]
Add "parquet" to the features list at the top of data-raw/codegen.R
This is the tricky part: in configure and configure.win, do a check similar to how we look for whether ARROW_S3 was enabled in the C++ build, and if so add -DARROW_R_WITH_PARQUET to PKG_CFLAGS. This will be trickier on Windows because I don't think the rwinlib bundle includes ArrowOptions.cmake (but it will always have Parquet enabled). An alternative (perhaps more robust approach) would be to follow the TEST_CMD approach and test for parquet/s3 headers (current L179 of configure).
In configure.win, you may also need to massage the PKG_LIBS since it has hard-coded that parquet and thrift are present (as they are in the rwinlib bundles). This is perhaps a separate issue from this (since this issue is particularly about Solaris and that's about doing different C++ dev builds on Windows.
Once you've done this, the build should succeed without Parquet, but tests that involve Parquet will error. Revise skip_if_not_available() in r/tests/testthat/helper-skip.R to check arrow_with_parquet() if feature == "parquet" (this function is generated by codegen.R), then add skip_if_not_available("parquet") to all relevant tests.
Search for arrow_with_s3() in the code and see where else we should do the same with arrow_with_parquet(). Among the uses:
Add parquet to arrow_info() alongside where arrow_with_s3() is checked
Wrap any parquet doc examples if (arrow_with_parquet())
Neal Richardson / @nealrichardson:
This may only be for historical reasons: when libarrow_dataset was created, it only worked for Parquet files, so the hard dependency made sense.
I don't know how disruptive it would be to make that dependency conditional (cc @bkietz). If we didn't want to go that route, we could extend this work in the R package to make both the dataset and parquet features conditional--dataset would work the same way I described above, it's in its own namespace like parquet is, etc.
Activity
asfimport commentedon Feb 26, 2021
Neal Richardson / @nealrichardson:
See r/data-raw/codegen.R for how this comes together (docs in comments at the top of the file), and look at the bottom of r/src/filesystem.cpp for an example of how this is working for s3. Changes to make:
parquet::something, header#includestatements of parquet paths) are inside#if defined(ARROW_R_WITH_PARQUET)// [[arrow::export]]annotations on those functions to be// [[parquet::export]]ARROW_S3was enabled in the C++ build, and if so add-DARROW_R_WITH_PARQUETto PKG_CFLAGS. This will be trickier on Windows because I don't think the rwinlib bundle includes ArrowOptions.cmake (but it will always have Parquet enabled). An alternative (perhaps more robust approach) would be to follow the TEST_CMD approach and test for parquet/s3 headers (current L179 of configure).arrow_with_parquet()if feature == "parquet" (this function is generated by codegen.R), then addskip_if_not_available("parquet")to all relevant tests.arrow_with_s3()in the code and see where else we should do the same with arrow_with_parquet(). Among the uses:if (arrow_with_parquet())asfimport commentedon Feb 26, 2021
Ian Cook / @ianmcook:
One problem here: pkg-config reports that the Arrow Dataset module depends on Parquet
Does it actually? From
CMakeLists.txt, it doesn't look like it:https://github.com/apache/arrow/blob/master/cpp/CMakeLists.txt#L339-L342
But there is a
find_package(Parquet)call inFindArrowDataset.cmake:https://github.com/apache/arrow/blob/master/cpp/cmake_modules/FindArrowDataset.cmake#L47
arrow-dataset.pc.inhasparquetin theRequires::https://github.com/apache/arrow/blob/master/cpp/src/arrow/dataset/arrow-dataset.pc.in#L24
c_glib/configure.acputs-lparquetinARROW_DATASET_LIBS:https://github.com/apache/arrow/blob/master/c_glib/configure.ac#L225
In the dataset subcomponent
CMakeLists.txt, everything Parquet-specific is guarded withif(ARROW_PARQUET):https://github.com/apache/arrow/blob/master/cpp/src/arrow/dataset/CMakeLists.txt
asfimport commentedon Feb 27, 2021
Neal Richardson / @nealrichardson:
This may only be for historical reasons: when libarrow_dataset was created, it only worked for Parquet files, so the hard dependency made sense.
I don't know how disruptive it would be to make that dependency conditional (cc @bkietz). If we didn't want to go that route, we could extend this work in the R package to make both the dataset and parquet features conditional--dataset would work the same way I described above, it's in its own namespace like parquet is, etc.
asfimport commentedon Mar 6, 2021
Neal Richardson / @nealrichardson:
Issue resolved by pull request 9610
#9610