Skip to content

Commit ebedfac

Browse files
yingsu00Lakehouse Engine Bot
authored andcommitted
fix(build): Gate velox_date_extract_benchmark on Presto+Spark functions
velox/benchmarks/basic/CMakeLists.txt unconditionally declared the velox_date_extract_benchmark target and linked it against both velox_functions_prestosql and velox_functions_spark. The benchmark's source (DateExtractBenchmark.cpp) genuinely uses both: - Line 29: functions::prestosql::registerDateTimeFunctions("") plus benchmark sets for year / month / day / quarter / day_of_year / last_day_of_month on DATE and TIMESTAMP inputs. - Line 30: functions::sparksql::registerFunctions("spark_") plus a spark_make_date(y, m, d) benchmark set at line 116. Either library being absent breaks the link. The presto-native-execution build configures with VELOX_ENABLE_SPARK_FUNCTIONS=OFF -- Spark functions are not needed for the native Presto worker -- which leaves velox_functions_spark undefined and produces: ld: library 'velox_functions_spark' not found c++: error: linker command failed with exit code 1 This benchmark is the only target in the tree that requires the consumer to opt into both function libraries simultaneously; every other consumer either uses only Presto functions or already guards its dependency on the matching VELOX_ENABLE_* flag. Existing parallel guards in the tree: - velox/functions/CMakeLists.txt:20,24 -- the top-level subdirectory adds for prestosql and sparksql are already gated on VELOX_ENABLE_PRESTO_FUNCTIONS and VELOX_ENABLE_SPARK_FUNCTIONS respectively. - velox/experimental/cudf/tests/CMakeLists.txt:233 -- the Spark-dependent cudf test is gated on VELOX_ENABLE_SPARK_FUNCTIONS. Gate add_executable and target_link_libraries on (VELOX_ENABLE_PRESTO_FUNCTIONS AND VELOX_ENABLE_SPARK_FUNCTIONS) so the benchmark is only built where both function libraries actually exist. Source is unchanged: the benchmark genuinely needs both at runtime, so building it with one disabled would not be useful. Alchemy-item: (ID = 1712) fix(build): Gate velox_date_extract_benchmark on Presto+Spark functions commit 1/1 - 3dd4b4c
1 parent 51a6e69 commit ebedfac

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

velox/benchmarks/basic/CMakeLists.txt

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,13 @@ target_link_libraries(
126126
velox_row_fast
127127
)
128128

129-
add_executable(velox_date_extract_benchmark DateExtractBenchmark.cpp)
130-
target_link_libraries(
131-
velox_date_extract_benchmark
132-
${velox_benchmark_deps}
133-
velox_vector_test_lib
134-
velox_functions_prestosql
135-
velox_functions_spark
136-
)
129+
if(${VELOX_ENABLE_PRESTO_FUNCTIONS} AND ${VELOX_ENABLE_SPARK_FUNCTIONS})
130+
add_executable(velox_date_extract_benchmark DateExtractBenchmark.cpp)
131+
target_link_libraries(
132+
velox_date_extract_benchmark
133+
${velox_benchmark_deps}
134+
velox_vector_test_lib
135+
velox_functions_prestosql
136+
velox_functions_spark
137+
)
138+
endif()

0 commit comments

Comments
 (0)