This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 2cc30eb1ed GH-45034: [C++] Remove Parquet requirement from Arrow Acero 
and from Arrow Dataset when not necessary (#45035)
2cc30eb1ed is described below

commit 2cc30eb1ed05470aff0dd6189e2bba943ea3fab7
Author: Raúl Cumplido <[email protected]>
AuthorDate: Tue Dec 17 01:06:32 2024 +0100

    GH-45034: [C++] Remove Parquet requirement from Arrow Acero and from Arrow 
Dataset when not necessary (#45035)
    
    ### Rationale for this change
    
    Currently we are defining Parquet as a requirement for Acero and for 
Dataset on `ArrowAceroConfig.cmake.in` and `ArrowDatasetConfig.cmake.in` 
respectively.
    
    Parquet should never be necessary for Acero and could be necessary for 
Dataset only if it has been built with Parquet support.
    
    ### What changes are included in this PR?
    
    Remove Parquet from `ArrowAceroConfig.cmake.in` and add it as optional 
dependency for `ArrowDatasetConfig.cmake.in`
    
    ### Are these changes tested?
    
    I've tested with a really minimal build of Arrow and Pyarrow. I don't think 
we want to add a build without Parquet but with Dataset and/or Acero at CI just 
to test this scenario.
    Logs for the local build without Parquet:
    ```
    -- Found Cython version: 3.0.11
    -- Arrow version: 19.0.0
    -- Found the Arrow shared library: 
/home/raulcd/code/dist/lib/libarrow.so.1900.0.0
    -- Found the Arrow import library: ARROW_IMPORT_LIB-NOTFOUND
    -- Found the Arrow static library:
    -- Building PyArrow with Dataset
    -- ArrowAcero version: 19.0.0
    -- Found the ArrowAcero shared library: 
/home/raulcd/code/dist/lib/libarrow_acero.so.1900.0.0
    -- Found the ArrowAcero import library: ARROW_ACERO_IMPORT_LIB-NOTFOUND
    -- Found the ArrowAcero static library:
    -- ArrowDataset version: 19.0.0
    -- Found the ArrowDataset shared library: 
/home/raulcd/code/dist/lib/libarrow_dataset.so.1900.0.0
    -- Found the ArrowDataset import library: ARROW_DATASET_IMPORT_LIB-NOTFOUND
    -- Found the ArrowDataset static library:
    -- Building PyArrow with Acero
    -- Parquet Encryption is NOT Enabled
    ```
    
    The `IMPORT_LIB-NOTFOUND` has always been present and it's not new.
    
    ### Are there any user-facing changes?
    
    No as this should have already been the case.
    * GitHub Issue: #45034
    
    Authored-by: Raúl Cumplido <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 cpp/src/arrow/acero/ArrowAceroConfig.cmake.in     | 1 -
 cpp/src/arrow/dataset/ArrowDatasetConfig.cmake.in | 8 +++++---
 cpp/src/arrow/dataset/CMakeLists.txt              | 2 ++
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/cpp/src/arrow/acero/ArrowAceroConfig.cmake.in 
b/cpp/src/arrow/acero/ArrowAceroConfig.cmake.in
index 124cbcbf3d..66aa2b4078 100644
--- a/cpp/src/arrow/acero/ArrowAceroConfig.cmake.in
+++ b/cpp/src/arrow/acero/ArrowAceroConfig.cmake.in
@@ -28,7 +28,6 @@
 
 include(CMakeFindDependencyMacro)
 find_dependency(Arrow)
-find_dependency(Parquet)
 
 include("${CMAKE_CURRENT_LIST_DIR}/ArrowAceroTargets.cmake")
 
diff --git a/cpp/src/arrow/dataset/ArrowDatasetConfig.cmake.in 
b/cpp/src/arrow/dataset/ArrowDatasetConfig.cmake.in
index 66b0302cbc..4573ac3718 100644
--- a/cpp/src/arrow/dataset/ArrowDatasetConfig.cmake.in
+++ b/cpp/src/arrow/dataset/ArrowDatasetConfig.cmake.in
@@ -26,10 +26,12 @@
 
 @PACKAGE_INIT@
 
+set(ARROW_DATASET_REQUIRED_DEPENDENCIES 
"@ARROW_DATASET_REQUIRED_DEPENDENCIES@")
+
 include(CMakeFindDependencyMacro)
-find_dependency(Arrow)
-find_dependency(ArrowAcero)
-find_dependency(Parquet)
+foreach(dependency ${ARROW_DATASET_REQUIRED_DEPENDENCIES})
+  find_dependency(${dependency})
+endforeach()
 
 include("${CMAKE_CURRENT_LIST_DIR}/ArrowDatasetTargets.cmake")
 
diff --git a/cpp/src/arrow/dataset/CMakeLists.txt 
b/cpp/src/arrow/dataset/CMakeLists.txt
index e48bcfaf65..bdb89ee891 100644
--- a/cpp/src/arrow/dataset/CMakeLists.txt
+++ b/cpp/src/arrow/dataset/CMakeLists.txt
@@ -32,8 +32,10 @@ set(ARROW_DATASET_SRCS
     scan_node.cc)
 
 set(ARROW_DATASET_PKG_CONFIG_REQUIRES "arrow-acero")
+set(ARROW_DATASET_REQUIRED_DEPENDENCIES Arrow ArrowAcero)
 if(ARROW_PARQUET)
   string(APPEND ARROW_DATASET_PKG_CONFIG_REQUIRES " parquet")
+  list(APPEND ARROW_DATASET_REQUIRED_DEPENDENCIES Parquet)
 endif()
 
 set(ARROW_DATASET_STATIC_LINK_LIBS)

Reply via email to