From ec9cb53cd715cc47dcd1348d002358fca1957eed Mon Sep 17 00:00:00 2001 From: Aaditya Srinivasan Date: Wed, 22 Jul 2026 20:18:34 +0530 Subject: [PATCH 01/12] Add ninja-release-jni-windows CMakePreset --- cpp/CMakePresets.json | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/cpp/CMakePresets.json b/cpp/CMakePresets.json index 17f6317e17e6..d96db49c45dd 100644 --- a/cpp/CMakePresets.json +++ b/cpp/CMakePresets.json @@ -681,6 +681,28 @@ "PARQUET_REQUIRE_ENCRYPTION": "OFF", "re2_SOURCE": "BUNDLED" } + }, + { + "name": "ninja-release-jni-windows", + "inherits": [ + "base-release" + ], + "displayName": "Build for JNI on Windows", + "cacheVariables": { + "ARROW_ACERO": "ON", + "ARROW_BUILD_SHARED": "OFF", + "ARROW_BUILD_STATIC": "ON", + "ARROW_CSV": "ON", + "ARROW_DATASET": "ON", + "ARROW_DEPENDENCY_USE_SHARED": "OFF", + "ARROW_ORC": "ON", + "ARROW_PARQUET": "ON", + "ARROW_S3": "ON", + "ARROW_SUBSTRAIT": "ON", + "PARQUET_BUILD_EXAMPLES": "OFF", + "PARQUET_BUILD_EXECUTABLES": "OFF", + "PARQUET_REQUIRE_ENCRYPTION": "OFF" + } } ] } From f625d37181fb561d9c00c2f9951b2ce2382d8c78 Mon Sep 17 00:00:00 2001 From: Aaditya Srinivasan Date: Wed, 22 Jul 2026 20:38:40 +0530 Subject: [PATCH 02/12] Add JNI Windows CI job --- .github/workflows/cpp_extra.yml | 122 ++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index 908d830b4856..a3e5920c2ee8 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -351,6 +351,128 @@ jobs: path: ccache key: jni-macos + jni-windows: + needs: check-enabled + if: needs.check-enabled.outputs.is_enabled == 'true' + name: JNI Windows + runs-on: windows-2022 + timeout-minutes: 240 + + steps: + - name: Disable Crash Dialogs + run: | + reg add ` + "HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting" ` + /v DontShowUI ` + /t REG_DWORD ` + /d 1 ` + /f + + - name: Checkout Arrow + uses: actions/checkout@v7 + with: + persist-credentials: false + fetch-depth: 0 + submodules: recursive + + - name: Install msys2 (for tzdata for ORC tests) + uses: msys2/setup-msys2@v2 + id: setup-msys2 + + - name: Install cmake + shell: bash + run: | + ci/scripts/install_cmake.sh 4.1.2 /usr + + - name: Install ccache + shell: bash + run: | + ci/scripts/install_ccache.sh 4.13.6 /usr + + - name: Setup ccache + shell: bash + run: | + ci/scripts/ccache_setup.sh + + - name: ccache info + id: ccache-info + shell: bash + run: | + echo "cache-dir=$(ccache --get-config cache_dir)" >> $GITHUB_OUTPUT + + - name: Restore ccache + uses: apache/infrastructure-actions/stash/restore@0ba14156c9f4c3cfbe4b0c9f36339ab0f8d81e53 + with: + path: ${{ steps.ccache-info.outputs.cache-dir }} + key: jni-windows + + - name: CMake + shell: cmd + run: | + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 + cmake ^ + -S cpp ^ + -B cpp.build ^ + --preset=ninja-release-jni-windows ^ + -DARROW_BUILD_TESTS=ON ^ + -DCMAKE_INSTALL_PREFIX=%CD%\cpp.install + + - name: Build + shell: cmd + run: | + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 + cmake --build cpp.build + + - name: Install + shell: cmd + run: | + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 + cmake --install cpp.build + + - name: Test + shell: cmd + env: + MSYS2_LOCATION: ${{ steps.setup-msys2.outputs.msys2-location }} + ARROW_TEST_DATA: ${{ github.workspace }}\testing\data + PARQUET_TEST_DATA: ${{ github.workspace }}\cpp\submodules\parquet-testing\data + run: | + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 + set TZDIR=%MSYS2_LOCATION%\usr\share\zoneinfo + + set exclude_tests=arrow-acero-asof-join-node-test + set exclude_tests=%exclude_tests%|arrow-acero-hash-join-node-test + + ctest ^ + --exclude-regex "%exclude_tests%" ^ + --label-regex unittest ^ + --output-on-failure ^ + --parallel %NUMBER_OF_PROCESSORS% ^ + --test-dir cpp.build ^ + --timeout 300 + + - name: Build example + shell: cmd + run: | + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 + + cmake ^ + -S cpp/examples/minimal_build ^ + -B cpp/examples/minimal_build.build ^ + -GNinja ^ + -DCMAKE_INSTALL_PREFIX=%CD%\cpp.install + + cmake --build cpp/examples/minimal_build.build + + call cpp\examples\minimal_build.build\arrow-example.exe + + - name: Save ccache + if: ${{ !cancelled() }} + continue-on-error: true + uses: apache/infrastructure-actions/stash/save@0ba14156c9f4c3cfbe4b0c9f36339ab0f8d81e53 + with: + path: ${{ steps.ccache-info.outputs.cache-dir }} + key: jni-windows + odbc-linux: needs: check-enabled if: needs.check-enabled.outputs.is_enabled == 'true' From b1a76066daab7d56fffd1206cc05daf12b3ae66f Mon Sep 17 00:00:00 2001 From: Aaditya Srinivasan Date: Thu, 23 Jul 2026 17:49:06 +0530 Subject: [PATCH 03/12] exp: Define ARROW_COMPUTE_STATIC for compute test object library --- cpp/src/arrow/compute/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpp/src/arrow/compute/CMakeLists.txt b/cpp/src/arrow/compute/CMakeLists.txt index e965b89ec055..88f9ae900647 100644 --- a/cpp/src/arrow/compute/CMakeLists.txt +++ b/cpp/src/arrow/compute/CMakeLists.txt @@ -46,6 +46,10 @@ if(ARROW_TESTING AND ARROW_COMPUTE) target_link_libraries(arrow_compute_testing PUBLIC $ PUBLIC ${ARROW_GTEST_GTEST}) + if(ARROW_BUILD_STATIC AND WIN32) + target_compile_definitions(arrow_compute_testing PUBLIC ARROW_COMPUTE_STATIC + ARROW_STATIC) + endif() endif() set(ARROW_COMPUTE_TEST_PREFIX "arrow-compute") From 1de6e9c9c2445762ef79bd1226f6cd0c30f07ccd Mon Sep 17 00:00:00 2001 From: Aaditya Srinivasan Date: Thu, 23 Jul 2026 18:49:16 +0530 Subject: [PATCH 04/12] Debug: Print Substrait CMake target properties --- cpp/src/arrow/engine/CMakeLists.txt | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/cpp/src/arrow/engine/CMakeLists.txt b/cpp/src/arrow/engine/CMakeLists.txt index adf98087ad1d..ac5c028357c6 100644 --- a/cpp/src/arrow/engine/CMakeLists.txt +++ b/cpp/src/arrow/engine/CMakeLists.txt @@ -70,6 +70,19 @@ foreach(LIB_TARGET ${ARROW_SUBSTRAIT_LIBRARIES}) target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_ENGINE_EXPORTING) endforeach() +message(STATUS "=== ARROW_SUBSTRAIT_LIBRARIES ===") + +foreach(LIB_TARGET ${ARROW_SUBSTRAIT_LIBRARIES}) + get_target_property(DEFS ${LIB_TARGET} COMPILE_DEFINITIONS) + get_target_property(IFACE_DEFS ${LIB_TARGET} INTERFACE_COMPILE_DEFINITIONS) + get_target_property(LINK_LIBS ${LIB_TARGET} LINK_LIBRARIES) + + message(STATUS "${LIB_TARGET}") + message(STATUS " COMPILE_DEFINITIONS=${DEFS}") + message(STATUS " INTERFACE_COMPILE_DEFINITIONS=${IFACE_DEFS}") + message(STATUS " LINK_LIBRARIES=${LINK_LIBS}") +endforeach() + set(ARROW_SUBSTRAIT_TEST_LINK_LIBS ${ARROW_SUBSTRAIT_LINK_lIBS} ${ARROW_TEST_LINK_LIBS}) if(ARROW_TEST_LINKAGE STREQUAL "static") list(APPEND ARROW_SUBSTRAIT_TEST_LINK_LIBS arrow_substrait_static @@ -94,3 +107,13 @@ add_arrow_test(substrait_test "arrow_substrait") add_subdirectory(substrait) + +get_target_property(TEST_DEFS substrait_test COMPILE_DEFINITIONS) +get_target_property(TEST_IFACE substrait_test INTERFACE_COMPILE_DEFINITIONS) + +message(STATUS "=== substrait_test ===") +message(STATUS "COMPILE_DEFINITIONS=${TEST_DEFS}") +message(STATUS "INTERFACE_COMPILE_DEFINITIONS=${TEST_IFACE}") + +get_target_property(TEST_LIBS substrait_test LINK_LIBRARIES) +message(STATUS "LINK_LIBRARIES=${TEST_LIBS}") From 628605dd24765f13dc0d91e9e00909dab33e2ad3 Mon Sep 17 00:00:00 2001 From: Aaditya Srinivasan Date: Thu, 23 Jul 2026 20:19:53 +0530 Subject: [PATCH 05/12] Revert "Debug: Print Substrait CMake target properties" This reverts commit 1de6e9c9c2445762ef79bd1226f6cd0c30f07ccd. --- cpp/src/arrow/engine/CMakeLists.txt | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/cpp/src/arrow/engine/CMakeLists.txt b/cpp/src/arrow/engine/CMakeLists.txt index ac5c028357c6..adf98087ad1d 100644 --- a/cpp/src/arrow/engine/CMakeLists.txt +++ b/cpp/src/arrow/engine/CMakeLists.txt @@ -70,19 +70,6 @@ foreach(LIB_TARGET ${ARROW_SUBSTRAIT_LIBRARIES}) target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_ENGINE_EXPORTING) endforeach() -message(STATUS "=== ARROW_SUBSTRAIT_LIBRARIES ===") - -foreach(LIB_TARGET ${ARROW_SUBSTRAIT_LIBRARIES}) - get_target_property(DEFS ${LIB_TARGET} COMPILE_DEFINITIONS) - get_target_property(IFACE_DEFS ${LIB_TARGET} INTERFACE_COMPILE_DEFINITIONS) - get_target_property(LINK_LIBS ${LIB_TARGET} LINK_LIBRARIES) - - message(STATUS "${LIB_TARGET}") - message(STATUS " COMPILE_DEFINITIONS=${DEFS}") - message(STATUS " INTERFACE_COMPILE_DEFINITIONS=${IFACE_DEFS}") - message(STATUS " LINK_LIBRARIES=${LINK_LIBS}") -endforeach() - set(ARROW_SUBSTRAIT_TEST_LINK_LIBS ${ARROW_SUBSTRAIT_LINK_lIBS} ${ARROW_TEST_LINK_LIBS}) if(ARROW_TEST_LINKAGE STREQUAL "static") list(APPEND ARROW_SUBSTRAIT_TEST_LINK_LIBS arrow_substrait_static @@ -107,13 +94,3 @@ add_arrow_test(substrait_test "arrow_substrait") add_subdirectory(substrait) - -get_target_property(TEST_DEFS substrait_test COMPILE_DEFINITIONS) -get_target_property(TEST_IFACE substrait_test INTERFACE_COMPILE_DEFINITIONS) - -message(STATUS "=== substrait_test ===") -message(STATUS "COMPILE_DEFINITIONS=${TEST_DEFS}") -message(STATUS "INTERFACE_COMPILE_DEFINITIONS=${TEST_IFACE}") - -get_target_property(TEST_LIBS substrait_test LINK_LIBRARIES) -message(STATUS "LINK_LIBRARIES=${TEST_LIBS}") From ed4c83c11513127eb9e6bf3e47f88a0ff8d5a1b7 Mon Sep 17 00:00:00 2001 From: Aaditya Srinivasan Date: Fri, 24 Jul 2026 09:05:30 +0530 Subject: [PATCH 06/12] Fix Substrait static linking --- cpp/src/arrow/engine/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cpp/src/arrow/engine/CMakeLists.txt b/cpp/src/arrow/engine/CMakeLists.txt index adf98087ad1d..dbb5d7e95abc 100644 --- a/cpp/src/arrow/engine/CMakeLists.txt +++ b/cpp/src/arrow/engine/CMakeLists.txt @@ -70,10 +70,13 @@ foreach(LIB_TARGET ${ARROW_SUBSTRAIT_LIBRARIES}) target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_ENGINE_EXPORTING) endforeach() +if(ARROW_BUILD_STATIC AND WIN32) + target_compile_definitions(arrow_substrait_static PUBLIC ARROW_ENGINE_STATIC) +endif() + set(ARROW_SUBSTRAIT_TEST_LINK_LIBS ${ARROW_SUBSTRAIT_LINK_lIBS} ${ARROW_TEST_LINK_LIBS}) if(ARROW_TEST_LINKAGE STREQUAL "static") - list(APPEND ARROW_SUBSTRAIT_TEST_LINK_LIBS arrow_substrait_static - arrow_substrait_static) + list(APPEND ARROW_SUBSTRAIT_TEST_LINK_LIBS arrow_substrait_static) else() list(APPEND ARROW_SUBSTRAIT_TEST_LINK_LIBS arrow_substrait_shared) endif() From ec622ba4443f4a2ce20e4c81a33f4633510808fc Mon Sep 17 00:00:00 2001 From: Aaditya Srinivasan Date: Fri, 24 Jul 2026 09:33:35 +0530 Subject: [PATCH 07/12] Fix Windows test exclude regex --- .github/workflows/cpp_extra.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index a3e5920c2ee8..9ee5167b4e64 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -440,7 +440,7 @@ jobs: set TZDIR=%MSYS2_LOCATION%\usr\share\zoneinfo set exclude_tests=arrow-acero-asof-join-node-test - set exclude_tests=%exclude_tests%|arrow-acero-hash-join-node-test + set exclude_tests=%exclude_tests%^|arrow-acero-hash-join-node-test ctest ^ --exclude-regex "%exclude_tests%" ^ From abf729f65dc93dd62f83ea50209c0e6289fe3bf3 Mon Sep 17 00:00:00 2001 From: Aaditya Srinivasan Date: Fri, 24 Jul 2026 10:11:32 +0530 Subject: [PATCH 08/12] Remove Build Example --- .github/workflows/cpp_extra.yml | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index 9ee5167b4e64..6d02744ea49b 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -429,6 +429,14 @@ jobs: call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 cmake --install cpp.build + - name: Save ccache + if: ${{ !cancelled() }} + continue-on-error: true + uses: apache/infrastructure-actions/stash/save@0ba14156c9f4c3cfbe4b0c9f36339ab0f8d81e53 + with: + path: ${{ steps.ccache-info.outputs.cache-dir }} + key: jni-windows + - name: Test shell: cmd env: @@ -450,29 +458,6 @@ jobs: --test-dir cpp.build ^ --timeout 300 - - name: Build example - shell: cmd - run: | - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 - - cmake ^ - -S cpp/examples/minimal_build ^ - -B cpp/examples/minimal_build.build ^ - -GNinja ^ - -DCMAKE_INSTALL_PREFIX=%CD%\cpp.install - - cmake --build cpp/examples/minimal_build.build - - call cpp\examples\minimal_build.build\arrow-example.exe - - - name: Save ccache - if: ${{ !cancelled() }} - continue-on-error: true - uses: apache/infrastructure-actions/stash/save@0ba14156c9f4c3cfbe4b0c9f36339ab0f8d81e53 - with: - path: ${{ steps.ccache-info.outputs.cache-dir }} - key: jni-windows - odbc-linux: needs: check-enabled if: needs.check-enabled.outputs.is_enabled == 'true' From c87f42b3ef5fff1a25098a6e4aff6d517e8ef373 Mon Sep 17 00:00:00 2001 From: Aaditya Srinivasan Date: Fri, 24 Jul 2026 11:12:18 +0530 Subject: [PATCH 09/12] Revert "Remove Build Example" This reverts commit abf729f65dc93dd62f83ea50209c0e6289fe3bf3. --- .github/workflows/cpp_extra.yml | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index 6d02744ea49b..9ee5167b4e64 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -429,14 +429,6 @@ jobs: call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 cmake --install cpp.build - - name: Save ccache - if: ${{ !cancelled() }} - continue-on-error: true - uses: apache/infrastructure-actions/stash/save@0ba14156c9f4c3cfbe4b0c9f36339ab0f8d81e53 - with: - path: ${{ steps.ccache-info.outputs.cache-dir }} - key: jni-windows - - name: Test shell: cmd env: @@ -458,6 +450,29 @@ jobs: --test-dir cpp.build ^ --timeout 300 + - name: Build example + shell: cmd + run: | + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 + + cmake ^ + -S cpp/examples/minimal_build ^ + -B cpp/examples/minimal_build.build ^ + -GNinja ^ + -DCMAKE_INSTALL_PREFIX=%CD%\cpp.install + + cmake --build cpp/examples/minimal_build.build + + call cpp\examples\minimal_build.build\arrow-example.exe + + - name: Save ccache + if: ${{ !cancelled() }} + continue-on-error: true + uses: apache/infrastructure-actions/stash/save@0ba14156c9f4c3cfbe4b0c9f36339ab0f8d81e53 + with: + path: ${{ steps.ccache-info.outputs.cache-dir }} + key: jni-windows + odbc-linux: needs: check-enabled if: needs.check-enabled.outputs.is_enabled == 'true' From 3b99cf34d7fe7c40d5f65f853da4564daa430e47 Mon Sep 17 00:00:00 2001 From: Aaditya Srinivasan Date: Fri, 24 Jul 2026 11:22:39 +0530 Subject: [PATCH 10/12] Debug: configure build --- .github/workflows/cpp_extra.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index 9ee5167b4e64..5d6481cdf0cf 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -461,7 +461,10 @@ jobs: -GNinja ^ -DCMAKE_INSTALL_PREFIX=%CD%\cpp.install - cmake --build cpp/examples/minimal_build.build + type cpp\examples\minimal_build.build\CMakeCache.txt | findstr CMAKE_BUILD_TYPE + type cpp\examples\minimal_build.build\CMakeCache.txt | findstr CMAKE_MSVC_RUNTIME_LIBRARY + + cmake --build cpp/examples/minimal_build.build --verbose call cpp\examples\minimal_build.build\arrow-example.exe From d6e54e42282171085ab5ccfabe0f61c5845586c8 Mon Sep 17 00:00:00 2001 From: Aaditya Srinivasan Date: Fri, 24 Jul 2026 11:52:49 +0530 Subject: [PATCH 11/12] Add release build type --- .github/workflows/cpp_extra.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml index 5d6481cdf0cf..c384f5f0f7f8 100644 --- a/.github/workflows/cpp_extra.yml +++ b/.github/workflows/cpp_extra.yml @@ -459,14 +459,13 @@ jobs: -S cpp/examples/minimal_build ^ -B cpp/examples/minimal_build.build ^ -GNinja ^ + -DCMAKE_BUILD_TYPE=Release ^ -DCMAKE_INSTALL_PREFIX=%CD%\cpp.install - type cpp\examples\minimal_build.build\CMakeCache.txt | findstr CMAKE_BUILD_TYPE - type cpp\examples\minimal_build.build\CMakeCache.txt | findstr CMAKE_MSVC_RUNTIME_LIBRARY - - cmake --build cpp/examples/minimal_build.build --verbose + cmake --build cpp/examples/minimal_build.build - call cpp\examples\minimal_build.build\arrow-example.exe + cd cpp\examples\minimal_build + call ..\minimal_build.build\arrow-example.exe - name: Save ccache if: ${{ !cancelled() }} From bd29d86d51dfefdf3ecfd3d4ceed704cd7bd5919 Mon Sep 17 00:00:00 2001 From: Aaditya Srinivasan Date: Fri, 24 Jul 2026 13:05:57 +0530 Subject: [PATCH 12/12] Enable compression libraries in JNI Windows preset --- cpp/CMakePresets.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpp/CMakePresets.json b/cpp/CMakePresets.json index d96db49c45dd..2780d19c6ee3 100644 --- a/cpp/CMakePresets.json +++ b/cpp/CMakePresets.json @@ -699,6 +699,10 @@ "ARROW_PARQUET": "ON", "ARROW_S3": "ON", "ARROW_SUBSTRAIT": "ON", + "ARROW_WITH_BROTLI": "ON", + "ARROW_WITH_LZ4": "ON", + "ARROW_WITH_SNAPPY": "ON", + "ARROW_WITH_ZSTD": "ON", "PARQUET_BUILD_EXAMPLES": "OFF", "PARQUET_BUILD_EXECUTABLES": "OFF", "PARQUET_REQUIRE_ENCRYPTION": "OFF"