diff --git a/.github/workflows/prestocpp-linux-adapters-build.yml b/.github/workflows/prestocpp-linux-adapters-build.yml index 82f0146d3c420..b8441122a9662 100644 --- a/.github/workflows/prestocpp-linux-adapters-build.yml +++ b/.github/workflows/prestocpp-linux-adapters-build.yml @@ -12,7 +12,7 @@ jobs: prestocpp-linux-adapters-build: runs-on: ubuntu-22.04 container: - image: prestodb/presto-native-dependency:0.293-20250522140509-484b00e + image: prestodb/presto-native-dependency:0.296-20251021214746-7eb2686 concurrency: group: ${{ github.workflow }}-prestocpp-linux-adapters-build-${{ github.event.pull_request.number }} cancel-in-progress: true diff --git a/.github/workflows/prestocpp-linux-build-and-unit-test.yml b/.github/workflows/prestocpp-linux-build-and-unit-test.yml index 554daeee95254..df01cbb878706 100644 --- a/.github/workflows/prestocpp-linux-build-and-unit-test.yml +++ b/.github/workflows/prestocpp-linux-build-and-unit-test.yml @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-22.04 needs: changes container: - image: prestodb/presto-native-dependency:0.293-20250522140509-484b00e + image: prestodb/presto-native-dependency:0.296-20251021214746-7eb2686 concurrency: group: ${{ github.workflow }}-prestocpp-linux-build-test-${{ github.event.pull_request.number }} cancel-in-progress: true @@ -79,8 +79,6 @@ jobs: github.event_name == 'schedule' || needs.changes.outputs.codechange == 'true' run: | source /opt/rh/gcc-toolset-12/enable - cp -r presto-native-tests/presto_cpp/tests presto-native-execution/presto_cpp/main/functions/dynamic_registry - echo "add_subdirectory(tests)" >> presto-native-execution/presto_cpp/main/functions/dynamic_registry/CMakeLists.txt cd presto-native-execution cmake \ -B _build/release \ @@ -128,13 +126,12 @@ jobs: path: | presto-native-execution/_build/release/presto_cpp/main/presto_server presto-native-execution/_build/release/velox/velox/functions/remote/server/velox_functions_remote_server_main - presto-native-execution/_build/release/presto_cpp/main/functions/dynamic_registry/tests/ prestocpp-linux-presto-e2e-tests: needs: [changes, prestocpp-linux-build-for-test] runs-on: ubuntu-22.04 container: - image: prestodb/presto-native-dependency:0.293-20250522140509-484b00e + image: prestodb/presto-native-dependency:0.296-20251021214746-7eb2686 env: MAVEN_OPTS: "-Xmx4G -XX:+ExitOnOutOfMemoryError" MAVEN_FAST_INSTALL: "-B -V --quiet -T 1C -DskipTests -Dair.check.skip-all -Dmaven.javadoc.skip=true" @@ -230,7 +227,7 @@ jobs: storage-format: [ "PARQUET", "DWRF" ] enable-sidecar: [ "true", "false" ] container: - image: prestodb/presto-native-dependency:0.293-20250522140509-484b00e + image: prestodb/presto-native-dependency:0.296-20251021214746-7eb2686 env: MAVEN_OPTS: "-Xmx4G -XX:+ExitOnOutOfMemoryError" MAVEN_FAST_INSTALL: "-B -V --quiet -T 1C -DskipTests -Dair.check.skip-all -Dmaven.javadoc.skip=true" @@ -255,6 +252,13 @@ jobs: name: presto-native-build path: presto-native-execution/_build/release + - name: Update velox + if: | + github.event_name == 'schedule' || needs.changes.outputs.codechange == 'true' + run: | + cd presto-native-execution + make velox-submodule + # Permissions are lost when uploading. Details here: https://github.com/actions/upload-artifact/issues/38 - name: Restore execute permissions and library path if: | @@ -324,7 +328,7 @@ jobs: storage-format: [ "PARQUET", "DWRF" ] enable-sidecar: [ "true", "false" ] container: - image: prestodb/presto-native-dependency:0.293-20250522140509-484b00e + image: prestodb/presto-native-dependency:0.296-20251021214746-7eb2686 env: MAVEN_OPTS: "-Xmx4G -XX:+ExitOnOutOfMemoryError" MAVEN_FAST_INSTALL: "-B -V --quiet -T 1C -DskipTests -Dair.check.skip-all -Dmaven.javadoc.skip=true" @@ -413,7 +417,7 @@ jobs: needs: [changes, prestocpp-linux-build-for-test] runs-on: ubuntu-22.04 container: - image: prestodb/presto-native-dependency:0.293-20250522140509-484b00e + image: prestodb/presto-native-dependency:0.296-20251021214746-7eb2686 env: MAVEN_OPTS: "-Xmx4G -XX:+ExitOnOutOfMemoryError" MAVEN_FAST_INSTALL: "-B -V --quiet -T 1C -DskipTests -Dair.check.skip-all -Dmaven.javadoc.skip=true" @@ -498,7 +502,7 @@ jobs: needs: [changes, prestocpp-linux-build-for-test] runs-on: ubuntu-22.04 container: - image: prestodb/presto-native-dependency:0.293-20250522140509-484b00e + image: prestodb/presto-native-dependency:0.296-20251021214746-7eb2686 env: MAVEN_OPTS: "-Xmx4G -XX:+ExitOnOutOfMemoryError" MAVEN_FAST_INSTALL: "-B -V --quiet -T 1C -DskipTests -Dair.check.skip-all -Dmaven.javadoc.skip=true" diff --git a/.github/workflows/prestocpp-linux-build.yml b/.github/workflows/prestocpp-linux-build.yml index 59a2075c74b48..5dce05e7cc64c 100644 --- a/.github/workflows/prestocpp-linux-build.yml +++ b/.github/workflows/prestocpp-linux-build.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-22.04 needs: changes container: - image: prestodb/presto-native-dependency:0.293-20250522140509-484b00e + image: prestodb/presto-native-dependency:0.296-20251021214746-7eb2686 volumes: - /usr:/host_usr - /opt:/host_opt diff --git a/presto-native-tests/CMakeLists.txt b/presto-native-tests/CMakeLists.txt index 6cd83f84951cf..141f8a7344195 100644 --- a/presto-native-tests/CMakeLists.txt +++ b/presto-native-tests/CMakeLists.txt @@ -14,7 +14,7 @@ cmake_minimum_required(VERSION 3.10) # set the project name project(PrestoCpp) -set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED True) message("Appending CMAKE_CXX_FLAGS with ${SCRIPT_CXX_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SCRIPT_CXX_FLAGS}") diff --git a/presto-native-tests/presto_cpp/tests/custom_functions/CMakeLists.txt b/presto-native-tests/presto_cpp/tests/custom_functions/CMakeLists.txt index a2d62155f91d5..0008f2eda3668 100644 --- a/presto-native-tests/presto_cpp/tests/custom_functions/CMakeLists.txt +++ b/presto-native-tests/presto_cpp/tests/custom_functions/CMakeLists.txt @@ -14,11 +14,17 @@ set(PRESTO_AND_VELOX_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/../presto-native-execution/velox ) -add_library(presto_cpp_custom_functions_test SHARED CustomFunctions.cpp) - +find_package(xsimd) set(CMAKE_DYLIB_TEST_LINK_LIBRARIES fmt::fmt xsimd) +if(APPLE) + message(STATUS "APPLE compilation requires gflags library. Appending.") + list(APPEND CMAKE_DYLIB_TEST_LINK_LIBRARIES "gflags::gflags") +endif() + +add_library(presto_cpp_custom_functions_test SHARED CustomFunctions.cpp) + target_include_directories(presto_cpp_custom_functions_test PRIVATE ${PRESTO_AND_VELOX_INCLUDE_DIRS} diff --git a/presto-native-tests/src/test/java/com/facebook/presto/nativetests/NativeTestsUtils.java b/presto-native-tests/src/test/java/com/facebook/presto/nativetests/NativeTestsUtils.java index 87382ba8ba445..aff8bab075254 100644 --- a/presto-native-tests/src/test/java/com/facebook/presto/nativetests/NativeTestsUtils.java +++ b/presto-native-tests/src/test/java/com/facebook/presto/nativetests/NativeTestsUtils.java @@ -31,7 +31,7 @@ public class NativeTestsUtils { private NativeTestsUtils() {} - public static QueryRunner createNativeQueryRunner(String storageFormat, boolean charNToVarcharImplicitCast, boolean sidecarEnabled) + public static QueryRunner createNativeQueryRunner(String storageFormat, boolean charNToVarcharImplicitCast, boolean sidecarEnabled, boolean customFunctionsEnabled) throws Exception { QueryRunner queryRunner = nativeHiveQueryRunnerBuilder() @@ -40,7 +40,7 @@ public static QueryRunner createNativeQueryRunner(String storageFormat, boolean .setUseThrift(true) .setImplicitCastCharNToVarchar(charNToVarcharImplicitCast) .setCoordinatorSidecarEnabled(sidecarEnabled) - .setPluginDirectory(sidecarEnabled ? Optional.of(getCustomFunctionsPluginDirectory().toString()) : Optional.empty()) + .setPluginDirectory(customFunctionsEnabled ? Optional.of(getCustomFunctionsPluginDirectory().toString()) : Optional.empty()) .build(); if (sidecarEnabled) { setupNativeSidecarPlugin(queryRunner); @@ -48,6 +48,12 @@ public static QueryRunner createNativeQueryRunner(String storageFormat, boolean return queryRunner; } + public static QueryRunner createNativeQueryRunner(String storageFormat, boolean charNToVarcharImplicitCast, boolean sidecarEnabled) + throws Exception + { + return createNativeQueryRunner(storageFormat, false, sidecarEnabled, false); + } + public static QueryRunner createNativeQueryRunner(String storageFormat, boolean sidecarEnabled) throws Exception { @@ -89,9 +95,7 @@ public static Path getCustomFunctionsPluginDirectory() // All candidate paths relative to prestoRoot List candidates = ImmutableList.of( prestoRoot.resolve("presto-native-tests/_build/debug/presto_cpp/tests/custom_functions"), - prestoRoot.resolve("presto-native-tests/_build/release/presto_cpp/tests/custom_functions"), - prestoRoot.resolve("presto-native-execution/_build/debug/presto_cpp/main/functions/dynamic_registry/tests/custom_functions"), - prestoRoot.resolve("presto-native-execution/_build/release/presto_cpp/main/functions/dynamic_registry/tests/custom_functions")); + prestoRoot.resolve("presto-native-tests/_build/release/presto_cpp/tests/custom_functions")); return candidates.stream() .filter(Files::exists) diff --git a/presto-native-tests/src/test/java/com/facebook/presto/nativetests/TestCustomFunctions.java b/presto-native-tests/src/test/java/com/facebook/presto/nativetests/TestCustomFunctions.java index 0ad7b7537f75a..d567d84c4bade 100644 --- a/presto-native-tests/src/test/java/com/facebook/presto/nativetests/TestCustomFunctions.java +++ b/presto-native-tests/src/test/java/com/facebook/presto/nativetests/TestCustomFunctions.java @@ -87,7 +87,7 @@ public void init() @Override protected QueryRunner createQueryRunner() throws Exception { - return NativeTestsUtils.createNativeQueryRunner(storageFormat, sidecarEnabled); + return NativeTestsUtils.createNativeQueryRunner(storageFormat, false, sidecarEnabled, true); } @Override