fix(build): Gate velox_date_extract_benchmark on Presto+Spark functions#2184
Open
yingsu00 wants to merge 1 commit into
Open
fix(build): Gate velox_date_extract_benchmark on Presto+Spark functions#2184yingsu00 wants to merge 1 commit into
yingsu00 wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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:
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.