Skip to content

Commit

Permalink
[native] Switch to using the Velox mono library
Browse files Browse the repository at this point in the history
This change makes use of the Velox mono library for non-test related
components. This removes the need to add individual velox
subcomponent libraries and cuts down on the linking size because symbols
are duplicated.

When adding new non-test velox dependencies use the velox library rather
than the individual velox component.
For tests, the velox components are still needed to be separately used.
  • Loading branch information
czentgr committed Jan 9, 2025
1 parent bef2e4d commit 0eedf85
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 40 deletions.
1 change: 1 addition & 0 deletions presto-native-execution/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ include_directories(${CMAKE_BINARY_DIR})
# set this for backwards compatibility, will be overwritten in velox/
set(VELOX_GTEST_INCUDE_DIR "velox/third_party/googletest/googletest/include")

set(VELOX_MONO_LIBRARY ON)
add_subdirectory(velox)

if(PRESTO_ENABLE_TESTING)
Expand Down
25 changes: 2 additions & 23 deletions presto-native-execution/presto_cpp/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,7 @@ target_link_libraries(
presto_http
presto_operators
presto_velox_conversion
velox_aggregates
velox_caching
velox_common_base
velox_core
velox_dwio_common_exception
velox_encode
velox_exec
velox_functions_lib
velox_functions_prestosql
velox_hive_connector
velox_hive_iceberg_splitreader
velox_hive_partition_function
velox_presto_serializer
velox_serialization
velox_time
velox_type_parser
velox_type
velox_type_fbhive
velox_type_tz
velox_vector
velox_window
velox
${RE2}
${FOLLY_WITH_DEPENDENCIES}
${GLOG}
Expand All @@ -94,8 +74,7 @@ add_executable(presto_server PrestoMain.cpp)
# results in multiple link errors similar to the one below only on GCC.
# "undefined reference to `vtable for velox::connector::tpch::TpchTableHandle`"
# TODO: Fix these errors.
target_link_libraries(presto_server presto_server_lib velox_hive_connector
velox_tpch_connector)
target_link_libraries(presto_server presto_server_lib velox)

if(PRESTO_ENABLE_REMOTE_FUNCTIONS)
add_library(presto_server_remote_function JsonSignatureParser.cpp
Expand Down
5 changes: 2 additions & 3 deletions presto-native-execution/presto_cpp/main/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
add_library(presto_exception Exception.cpp)
add_library(presto_common Counters.cpp Utils.cpp ConfigReader.cpp Configs.cpp)

target_link_libraries(presto_exception velox_exception)
target_link_libraries(presto_exception velox)
set_property(TARGET presto_exception PROPERTY JOB_POOL_LINK
presto_link_job_pool)

target_link_libraries(presto_common velox_common_config velox_core
velox_exception)
target_link_libraries(presto_common velox)
set_property(TARGET presto_common PROPERTY JOB_POOL_LINK presto_link_job_pool)

if(PRESTO_ENABLE_TESTING)
Expand Down
3 changes: 1 addition & 2 deletions presto-native-execution/presto_cpp/main/http/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ target_link_libraries(
presto_http
http_filters
presto_common
velox_memory
velox_exception
velox
${PROXYGEN_LIBRARIES}
${LIBSODIUM_LIBRARY}
${OPENSSL_SSL_LIBRARY}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ add_library(
target_link_libraries(
presto_operators
presto_common
velox_core
velox_exec
velox_presto_serializer
velox_vector
velox_row_fast)
velox)

if(PRESTO_ENABLE_TESTING)
add_subdirectory(tests)
Expand Down
10 changes: 4 additions & 6 deletions presto-native-execution/presto_cpp/main/types/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,19 @@ add_library(
presto_types OBJECT
PrestoToVeloxQueryPlan.cpp PrestoToVeloxExpr.cpp VeloxPlanValidator.cpp
PrestoToVeloxSplit.cpp PrestoToVeloxConnector.cpp)
add_dependencies(presto_types presto_operators presto_type_converter velox_type
velox_type_fbhive)
add_dependencies(presto_types presto_operators presto_type_converter velox)

target_link_libraries(presto_types presto_type_converter velox_type_fbhive
velox_hive_partition_function velox_tpch_gen)
target_link_libraries(presto_types presto_type_converter velox)

set_property(TARGET presto_types PROPERTY JOB_POOL_LINK presto_link_job_pool)

add_library(presto_function_metadata OBJECT FunctionMetadata.cpp)

target_link_libraries(presto_function_metadata velox_function_registry)
target_link_libraries(presto_function_metadata velox)

add_library(presto_velox_conversion OBJECT VeloxPlanConversion.cpp)

target_link_libraries(presto_velox_conversion velox_type)
target_link_libraries(presto_velox_conversion velox)

if(PRESTO_ENABLE_TESTING)
add_subdirectory(tests)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ add_library(
presto_protocol OBJECT presto_protocol.cpp Base64Util.cpp core/DataSize.cpp
core/Duration.cpp core/ConnectorProtocol.cpp)

target_link_libraries(presto_protocol velox_type velox_presto_serializer ${RE2})
target_link_libraries(presto_protocol velox_type velox ${RE2})

if(PRESTO_ENABLE_TESTING)
add_subdirectory(tests)
Expand Down

0 comments on commit 0eedf85

Please sign in to comment.