Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 9 additions & 82 deletions be/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -625,77 +625,16 @@ if (BUILD_BENCHMARK)
endif()

set(PAIMON_FACTORY_REGISTRY_LIBS)
set(PAIMON_ARROW_CORE_LIB)
set(PAIMON_ARROW_FILESYSTEM_LIB)
set(PAIMON_ARROW_DATASET_LIB)
set(PAIMON_ARROW_ACERO_LIB)
if (ENABLE_PAIMON_CPP)
set(_paimon_arrow_core_candidates
${THIRDPARTY_DIR}/paimon-cpp/lib64/paimon_deps/libarrow.a
${THIRDPARTY_DIR}/lib64/libarrow.a
${THIRDPARTY_DIR}/lib/libarrow.a
)
foreach(_paimon_arrow_core_candidate IN LISTS _paimon_arrow_core_candidates)
if (EXISTS "${_paimon_arrow_core_candidate}")
add_library(paimon_arrow_core STATIC IMPORTED)
set_target_properties(paimon_arrow_core PROPERTIES
IMPORTED_LOCATION ${_paimon_arrow_core_candidate})
set(PAIMON_ARROW_CORE_LIB paimon_arrow_core)
break()
endif()
endforeach()
set(_paimon_arrow_filesystem_candidates
${THIRDPARTY_DIR}/paimon-cpp/lib64/paimon_deps/libarrow_filesystem.a
${THIRDPARTY_DIR}/lib64/libarrow_filesystem.a
${THIRDPARTY_DIR}/lib/libarrow_filesystem.a
)
foreach(_paimon_arrow_filesystem_candidate IN LISTS _paimon_arrow_filesystem_candidates)
if (EXISTS "${_paimon_arrow_filesystem_candidate}")
add_library(paimon_arrow_filesystem STATIC IMPORTED)
set_target_properties(paimon_arrow_filesystem PROPERTIES
IMPORTED_LOCATION ${_paimon_arrow_filesystem_candidate})
set(PAIMON_ARROW_FILESYSTEM_LIB paimon_arrow_filesystem)
break()
endif()
endforeach()
set(_paimon_arrow_dataset_candidates
${THIRDPARTY_DIR}/paimon-cpp/lib64/paimon_deps/libarrow_dataset.a
${THIRDPARTY_DIR}/lib64/libarrow_dataset.a
${THIRDPARTY_DIR}/lib/libarrow_dataset.a
)
foreach(_paimon_arrow_dataset_candidate IN LISTS _paimon_arrow_dataset_candidates)
if (EXISTS "${_paimon_arrow_dataset_candidate}")
add_library(paimon_arrow_dataset STATIC IMPORTED)
set_target_properties(paimon_arrow_dataset PROPERTIES
IMPORTED_LOCATION ${_paimon_arrow_dataset_candidate})
set(PAIMON_ARROW_DATASET_LIB paimon_arrow_dataset)
break()
endif()
endforeach()
set(_paimon_arrow_acero_candidates
${THIRDPARTY_DIR}/paimon-cpp/lib64/paimon_deps/libarrow_acero.a
${THIRDPARTY_DIR}/lib64/libarrow_acero.a
${THIRDPARTY_DIR}/lib/libarrow_acero.a
)
foreach(_paimon_arrow_acero_candidate IN LISTS _paimon_arrow_acero_candidates)
if (EXISTS "${_paimon_arrow_acero_candidate}")
add_library(paimon_arrow_acero STATIC IMPORTED)
set_target_properties(paimon_arrow_acero PROPERTIES
IMPORTED_LOCATION ${_paimon_arrow_acero_candidate})
set(PAIMON_ARROW_ACERO_LIB paimon_arrow_acero)
break()
endif()
endforeach()
if (PAIMON_ARROW_DATASET_LIB)
# paimon_parquet_file_format depends on Arrow Dataset symbols.
# Force-link it only when arrow_dataset is available.
set(PAIMON_FACTORY_REGISTRY_LIBS
paimon_parquet_file_format
)
list(REMOVE_ITEM COMMON_THIRDPARTY ${PAIMON_FACTORY_REGISTRY_LIBS})
else()
message(STATUS "Paimon C++: libarrow_dataset.a not found, keep paimon_parquet_file_format as regular static lib")
endif()
# Plan B: Doris Arrow is now built with COMPUTE/DATASET/ACERO/FILESYSTEM,
# so arrow, arrow_dataset, arrow_acero are all in COMMON_THIRDPARTY via
# thirdparty.cmake. paimon-cpp reuses the same Arrow (no paimon_deps).
# No dual-stack selection needed — single Arrow for everything.

# paimon_parquet_file_format depends on Arrow Dataset symbols.
# Force-link it with --whole-archive so its factory registration runs.
set(PAIMON_FACTORY_REGISTRY_LIBS paimon_parquet_file_format)
list(REMOVE_ITEM COMMON_THIRDPARTY ${PAIMON_FACTORY_REGISTRY_LIBS})
endif()

set(DORIS_DEPENDENCIES
Expand All @@ -722,18 +661,6 @@ if (ENABLE_PAIMON_CPP)
${PAIMON_FACTORY_REGISTRY_LIBS}
-Wl,--no-whole-archive)
endif()
if (PAIMON_ARROW_CORE_LIB)
set(DORIS_DEPENDENCIES ${DORIS_DEPENDENCIES} ${PAIMON_ARROW_CORE_LIB})
endif()
if (PAIMON_ARROW_FILESYSTEM_LIB)
set(DORIS_DEPENDENCIES ${DORIS_DEPENDENCIES} ${PAIMON_ARROW_FILESYSTEM_LIB})
endif()
if (PAIMON_ARROW_DATASET_LIB)
set(DORIS_DEPENDENCIES ${DORIS_DEPENDENCIES} ${PAIMON_ARROW_DATASET_LIB})
endif()
if (PAIMON_ARROW_ACERO_LIB)
set(DORIS_DEPENDENCIES ${DORIS_DEPENDENCIES} ${PAIMON_ARROW_ACERO_LIB})
endif()

# paimon-cpp internal dependencies (renamed with _paimon suffix)
# These must come after paimon libraries to resolve symbols.
Expand Down
2 changes: 2 additions & 0 deletions be/cmake/thirdparty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ add_thirdparty(zstd LIB64)
add_thirdparty(arrow LIB64)
add_thirdparty(arrow_flight LIB64)
add_thirdparty(arrow_flight_sql LIB64)
add_thirdparty(arrow_dataset LIB64)
add_thirdparty(arrow_acero LIB64)
add_thirdparty(parquet LIB64)
add_thirdparty(brpc LIB64)
add_thirdparty(rocksdb)
Expand Down
Loading