Skip to content

Commit f2bc664

Browse files
authored
Merge branch 'main' into dependabot/go_modules/go/adbc/google.golang.org/api-0.228.0
2 parents 9e08d0a + a3a39d8 commit f2bc664

276 files changed

Lines changed: 6593 additions & 893 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/java.yml

Lines changed: 116 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
runs-on: ubuntu-latest
4747
strategy:
4848
matrix:
49-
java: ['11', '17', '21', '22']
49+
java: ['11', '17', '21', '24']
5050
steps:
5151
- uses: actions/checkout@v4
5252
with:
@@ -102,3 +102,118 @@ jobs:
102102
HERE
103103
# Our linters are compile-time, no point re-running tests
104104
mvn -P errorprone install -DskipTests
105+
106+
java-jni-artifacts:
107+
name: "JNI Libraries/${{ matrix.os }} ${{ matrix.arch }}"
108+
runs-on: ${{ matrix.runner }}
109+
strategy:
110+
matrix:
111+
include:
112+
- { os: Linux, arch: amd64, vcpkg_arch: x64, runner: ubuntu-latest }
113+
- { os: macOS, arch: arm64v8, vcpkg_arch: arm64, runner: macos-latest }
114+
env:
115+
VCPKG_ROOT: "${{ github.workspace }}/vcpkg"
116+
steps:
117+
- uses: actions/checkout@v4
118+
with:
119+
fetch-depth: 0
120+
persist-credentials: false
121+
- uses: actions/setup-java@v4
122+
with:
123+
cache: "maven"
124+
distribution: "temurin"
125+
java-version: 11
126+
- name: Retrieve Go, VCPKG version from .env
127+
run: |
128+
(. .env && echo "GO_VERSION=${GO}") >> $GITHUB_ENV
129+
(. .env && echo "VCPKG_VERSION=${VCPKG}") >> $GITHUB_ENV
130+
- name: Install vcpkg
131+
run: |
132+
./ci/scripts/install_vcpkg.sh $VCPKG_ROOT $VCPKG_VERSION
133+
- uses: actions/setup-go@v5
134+
with:
135+
go-version: "${{ env.GO_VERSION }}"
136+
check-latest: true
137+
cache: true
138+
cache-dependency-path: adbc/go/adbc/go.sum
139+
- name: Install Homebrew dependencies
140+
if: matrix.os == 'macOS'
141+
run: brew install autoconf bash pkg-config ninja
142+
- name: Build artifacts
143+
if: matrix.os != 'macOS'
144+
run: |
145+
docker compose run python-wheel-manylinux-build
146+
- name: Build artifacts (macOS)
147+
if: matrix.os == 'macOS'
148+
run: |
149+
export ADBC_BUILD_STATIC=ON
150+
export ADBC_BUILD_TESTS=OFF
151+
export ADBC_USE_ASAN=OFF
152+
export ADBC_USE_UBSAN=OFF
153+
./ci/scripts/python_wheel_unix_build.sh ${{ matrix.arch }} $(pwd) $(pwd)/build
154+
- name: Build JNI artifacts
155+
run: |
156+
export ADBC_BUILD_STATIC=ON
157+
export ADBC_BUILD_TESTS=OFF
158+
export ADBC_USE_ASAN=OFF
159+
export ADBC_USE_UBSAN=OFF
160+
./ci/scripts/java_build.sh $(pwd)
161+
./ci/scripts/java_jni_build.sh $(pwd) $(pwd)/build_jni $(pwd)/build/${{ matrix.vcpkg_arch }}
162+
- name: Assemble artifacts
163+
run: |
164+
mkdir artifacts
165+
cp -r java/driver/jni/src/main/resources/ artifacts/jni
166+
cp -r build/${{ matrix.vcpkg_arch }}/lib artifacts/driver
167+
ls -laR artifacts
168+
mv artifacts artifacts-${{ matrix.os }}-${{ matrix.arch }}
169+
tar czf artifacts-${{ matrix.os }}-${{ matrix.arch }}.tgz artifacts-${{ matrix.os }}-${{ matrix.arch }}
170+
- uses: actions/upload-artifact@v4
171+
with:
172+
name: jni-artifacts-${{ matrix.os }}-${{ matrix.arch }}
173+
retention-days: 7
174+
path: |
175+
artifacts-${{ matrix.os }}-${{ matrix.arch }}.tgz
176+
177+
java-jni:
178+
name: "Java ${{ matrix.java }} JNI/${{ matrix.os }} ${{ matrix.arch }}"
179+
runs-on: ${{ matrix.runner }}
180+
needs:
181+
- java-jni-artifacts
182+
strategy:
183+
matrix:
184+
java: ['11', '24']
185+
include:
186+
- { os: Linux, arch: amd64, vcpkg_arch: x64, runner: ubuntu-latest }
187+
- { os: macOS, arch: arm64v8, vcpkg_arch: arm64, runner: macos-latest }
188+
steps:
189+
- uses: actions/checkout@v4
190+
with:
191+
fetch-depth: 0
192+
persist-credentials: false
193+
submodules: recursive
194+
- uses: actions/download-artifact@v4
195+
with:
196+
path: artifacts
197+
pattern: jni-artifacts-*
198+
merge-multiple: true
199+
- uses: actions/setup-java@v4
200+
with:
201+
cache: "maven"
202+
distribution: "temurin"
203+
java-version: 11
204+
- name: Build/Test
205+
run: |
206+
set -x
207+
pushd artifacts
208+
for archive in artifacts*.tgz; do
209+
tar xvf $archive
210+
done
211+
popd
212+
cp -r artifacts/*/jni/adbc_driver_jni java/driver/jni/src/main/resources
213+
for driver in artifacts/*/driver; do
214+
export LD_LIBRARY_PATH=$(pwd)/$driver:${LD_LIBRARY_PATH:-}
215+
export DYLD_LIBRARY_PATH=$(pwd)/$driver:${DYLD_LIBRARY_PATH:-}
216+
done
217+
env BUILD_JNI=ON ./ci/scripts/java_build.sh $(pwd)
218+
cd java
219+
mvn -B -Pjni test -pl :adbc-driver-jni

.github/workflows/packaging.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ jobs:
9999
strategy:
100100
matrix:
101101
os: ["ubuntu-latest", "windows-latest", "macos-13"]
102-
go-version: [1.21.8] # Customize Go versions as needed
103102

104103
steps:
105104
- uses: actions/download-artifact@v4
@@ -116,10 +115,13 @@ jobs:
116115
tar xf apache-arrow-adbc-${VERSION}.tar.gz
117116
mv apache-arrow-adbc-${VERSION} adbc
118117
118+
- name: Get required Go version
119+
run: |
120+
(. adbc/.env && echo "GO_VERSION=${GO}") >> $GITHUB_ENV
119121
- name: Setup Go
120122
uses: actions/setup-go@v5
121123
with:
122-
go-version: ${{ matrix.go-version }}
124+
go-version: "${{ env.GO_VERSION }}"
123125
check-latest: true
124126
cache: true
125127
cache-dependency-path: adbc/go/adbc/go.sum
@@ -342,7 +344,7 @@ jobs:
342344
mv apache-arrow-adbc-$VERSION.tar.gz adbc/ci/linux-packages/
343345
344346
- name: Set up Ruby
345-
uses: ruby/setup-ruby@1a615958ad9d422dd932dc1d5823942ee002799f # v1.227.0
347+
uses: ruby/setup-ruby@e5ac7b085f6e63d49c8973eb0c6e04d876b881f1 # v1.230.0
346348
with:
347349
ruby-version: ruby
348350

@@ -721,9 +723,13 @@ jobs:
721723
ci/scripts/install_vcpkg.sh $VCPKG_ROOT $VCPKG_VERSION
722724
popd
723725
726+
- name: Get required Go version
727+
run: |
728+
(. adbc/.env && echo "GO_VERSION=${GO}") >> $GITHUB_ENV
729+
724730
- uses: actions/setup-go@v5
725731
with:
726-
go-version: 1.21.8
732+
go-version: "${{ env.GO_VERSION }}"
727733
check-latest: true
728734
cache: true
729735
cache-dependency-path: adbc/go/adbc/go.sum

.github/workflows/r-basic.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,29 @@ permissions:
3838
contents: read
3939

4040
jobs:
41-
check:
41+
check-c:
4242
strategy:
4343
matrix:
4444
os: [ubuntu]
45-
pkg: [adbcdrivermanager, adbcsqlite, adbcpostgresql, adbcflightsql, adbcsnowflake]
45+
pkg: [adbcdrivermanager, adbcsqlite, adbcpostgresql]
4646

4747
uses: ./.github/workflows/r-check.yml
4848
with:
4949
os: ${{ matrix.os }}
5050
pkg: ${{ matrix.pkg }}
51+
52+
check-go:
53+
strategy:
54+
matrix:
55+
os: [ubuntu]
56+
pkg: [adbcflightsql, adbcsnowflake, adbcbigquery]
57+
58+
uses: ./.github/workflows/r-check.yml
59+
with:
60+
os: ${{ matrix.os }}
61+
pkg: ${{ matrix.pkg }}
62+
# For the r-basic check (that runs on many PRs), just check ERRORs
63+
# (e.g., build failure, test failure)
64+
error-on: error
5165
secrets:
5266
SNOWFLAKE_URI: ${{ secrets.SNOWFLAKE_URI }}

.github/workflows/r-check.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ on:
3131
required: false
3232
default: release
3333
type: string
34+
error-on:
35+
required: false
36+
default: warning
37+
type: string
3438
secrets:
3539
SNOWFLAKE_URI:
3640
required: false
@@ -100,6 +104,7 @@ jobs:
100104
R_KEEP_PKG_SOURCE: yes
101105
with:
102106
working-directory: r/${{ inputs.pkg }}
107+
error-on: '"${{ inputs.error-on }}"'
103108

104109
- name: Shutdown docker compose services
105110
if: runner.os == 'Linux'

.github/workflows/r-extended.yml

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,48 +39,65 @@ permissions:
3939
jobs:
4040

4141
# Runs R CMD check on the same platforms/R versions CRAN does
42-
cran:
42+
cran-c:
4343
strategy:
4444
matrix:
4545
rversion: [oldrel, release, devel]
4646
os: [macOS, windows, ubuntu]
47-
pkg: [adbcdrivermanager, adbcsqlite, adbcpostgresql, adbcflightsql, adbcsnowflake, adbcbigquery]
47+
pkg: [adbcdrivermanager, adbcsqlite, adbcpostgresql]
48+
fail-fast: false
49+
50+
uses: ./.github/workflows/r-check.yml
51+
with:
52+
os: ${{ matrix.os }}
53+
pkg: ${{ matrix.pkg }}
54+
rversion: ${{ matrix.rversion }}
55+
56+
# Go-based drivers are not distributed on CRAN and are checked with error-on error only
57+
cran-go:
58+
strategy:
59+
matrix:
60+
rversion: [oldrel, release, devel]
61+
os: [macOS, windows, ubuntu]
62+
pkg: [adbcflightsql, adbcsnowflake, adbcbigquery]
4863
fail-fast: false
4964

5065
uses: ./.github/workflows/r-check.yml
5166
with:
5267
os: ${{ matrix.os }}
5368
pkg: ${{ matrix.pkg }}
5469
rversion: ${{ matrix.rversion }}
70+
# Go based drivers generate WARNINGs because some symbols
71+
# are linked in that R CMD check does not allow.
72+
error-on: error
5573
secrets:
5674
SNOWFLAKE_URI: ${{ secrets.SNOWFLAKE_URI }}
5775

5876
# Check older versions of R on Linux. This catches accidental use of newer R functions.
77+
# We don't check Go drivers here because they don't have much R API surface area.
5978
rversions:
6079
strategy:
6180
matrix:
6281
rversion: ["3.6", "4.0", "4.1"]
6382
os: [ubuntu]
64-
pkg: [adbcdrivermanager, adbcsqlite, adbcpostgresql, adbcflightsql, adbcsnowflake, adbcbigquery]
83+
pkg: [adbcdrivermanager, adbcsqlite, adbcpostgresql]
6584
fail-fast: false
6685

6786
uses: ./.github/workflows/r-check.yml
6887
with:
6988
os: ${{ matrix.os }}
7089
pkg: ${{ matrix.pkg }}
7190
rversion: ${{ matrix.rversion }}
72-
secrets:
73-
SNOWFLAKE_URI: ${{ secrets.SNOWFLAKE_URI }}
7491

7592
# Checks on older verions of R on Windows. The Windows build system changed
7693
# several times so we need to check packages on every version. Go-based
7794
# drivers aren't supported before 4.2, so we don't check them here.
78-
# We don't need to check R 4.1 because the build system for R 4.0 and R 4.1
79-
# are the same.
95+
# The test dependencies support the released version and the four previous
96+
# versions (e.g., 4.1 is the minimum supported version as of R 4.5).
8097
winrversions:
8198
strategy:
8299
matrix:
83-
rversion: ["3.6", "4.0"]
100+
rversion: ["4.1"]
84101
os: [windows]
85102
pkg: [adbcdrivermanager, adbcsqlite, adbcpostgresql]
86103
fail-fast: false
@@ -90,8 +107,6 @@ jobs:
90107
os: ${{ matrix.os }}
91108
pkg: ${{ matrix.pkg }}
92109
rversion: ${{ matrix.rversion }}
93-
secrets:
94-
SNOWFLAKE_URI: ${{ secrets.SNOWFLAKE_URI }}
95110

96111
# Runs tests with valgrind. Go does not support valgrind, so we don't run
97112
# those tests here.

.github/workflows/r-standard.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,30 @@ permissions:
4646
contents: read
4747

4848
jobs:
49-
check:
49+
check-c:
5050
strategy:
5151
matrix:
5252
os: [ubuntu, macOS, windows]
53-
pkg: [adbcdrivermanager, adbcsqlite, adbcpostgresql, adbcflightsql, adbcsnowflake, adbcbigquery]
53+
pkg: [adbcdrivermanager, adbcsqlite, adbcpostgresql]
5454

5555
uses: ./.github/workflows/r-check.yml
5656
with:
5757
os: ${{ matrix.os }}
5858
pkg: ${{ matrix.pkg }}
59+
60+
# Go-based drivers are not distributed on CRAN and are checked with error-on error only
61+
check-go:
62+
strategy:
63+
matrix:
64+
os: [ubuntu, macOS, windows]
65+
pkg: [adbcflightsql, adbcsnowflake, adbcbigquery]
66+
67+
uses: ./.github/workflows/r-check.yml
68+
with:
69+
os: ${{ matrix.os }}
70+
pkg: ${{ matrix.pkg }}
71+
# Go based drivers generate WARNINGs because some symbols
72+
# are linked in that R CMD check does not allow.
73+
error-on: error
5974
secrets:
6075
SNOWFLAKE_URI: ${{ secrets.SNOWFLAKE_URI }}

CONTRIBUTING.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,43 @@ mvn install -Perrorprone
316316
[checker-framework]: https://checkerframework.org/
317317
[errorprone]: https://errorprone.info/
318318

319+
#### JNI
320+
321+
To build the JNI bridge, the native components must be built.
322+
323+
```
324+
# Build the driver manager
325+
export ADBC_BUILD_STATIC=ON
326+
export ADBC_BUILD_TESTS=OFF
327+
export ADBC_USE_ASAN=OFF
328+
export ADBC_USE_UBSAN=OFF
329+
export BUILD_ALL=OFF
330+
export BUILD_DRIVER_MANAGER=ON
331+
export BUILD_DRIVER_SQLITE=ON
332+
./ci/scripts/cpp_build.sh $(pwd) $(pwd)/build $(pwd)/local
333+
334+
# Build the JNI libraries
335+
./ci/scripts/java_jni_build.sh $(pwd) $(pwd)/java/build $(pwd)/local
336+
```
337+
338+
Now build the Java code with the `jni` Maven profile enabled. To run tests,
339+
the SQLite driver must also be present in (DY)LD_LIBRARY_PATH.
340+
341+
```
342+
export LD_LIBRARY_PATH=$(pwd)/local/lib
343+
pushd java
344+
mvn install -Pjni
345+
popd
346+
```
347+
348+
This will build a JAR with native libraries for a single platform. If the
349+
native libraries are built for multiple platforms, they can all be copied to
350+
appropriate paths in the resources directory to build a single JAR that works
351+
across multiple platforms.
352+
353+
You can also build and test in IntelliJ; simply edit the run/test
354+
configuration to add `LD_LIBRARY_PATH` to the environment.
355+
319356
### Python
320357

321358
Python libraries are managed with [setuptools][setuptools]. See

0 commit comments

Comments
 (0)