Skip to content

Commit

Permalink
apacheGH-41725: [Python] CMake: ignore Parquet encryption option if P…
Browse files Browse the repository at this point in the history
…arquet itself is not enabled (fix Java integration build) (apache#41776)

### Rationale for this change

Because of refactoring in apache#41480, explicitly enabling `PYARROW_WITH_PARQUET_ENCRYPTION` without enabling `PYARROW_WITH_PARQUET` (and without Arrow C++ being built with Parquet support) now raises an error, while before we checked in `setup.py` that both were enabled for enabling encryption support. This patch mimics that logic in CMakeLists.txt with a warning added.

### What changes are included in this PR?

When PyArrow with Parquet Encryption is enabled but PyArrow with Parquet itself is not, ignore the encryption setting, but warn about it.

### Are these changes tested?

Yes

* GitHub Issue: apache#41725

Authored-by: Joris Van den Bossche <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
jorisvandenbossche authored and vibhatha committed May 25, 2024
1 parent b90c2ef commit 9c5351b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,18 @@ if(PYARROW_BUILD_ACERO)
endif()
endif()

if(PYARROW_BUILD_PARQUET OR PYARROW_BUILD_PARQUET_ENCRYPTION)
if(PYARROW_BUILD_PARQUET)
message(STATUS "Building PyArrow with Parquet")
if(NOT ARROW_PARQUET)
message(FATAL_ERROR "You must build Arrow C++ with ARROW_PARQUET=ON")
endif()
find_package(Parquet REQUIRED)
else()
if(PYARROW_BUILD_PARQUET_ENCRYPTION)
message(WARNING "Building PyArrow with Parquet Encryption is requested, but Parquet itself is not enabled. Ignoring the Parquet Encryption setting."
)
set(PYARROW_BUILD_PARQUET_ENCRYPTION OFF)
endif()
endif()

# Check for only Arrow C++ options
Expand Down

0 comments on commit 9c5351b

Please sign in to comment.