Skip to content

Commit d4620cf

Browse files
feat: Add Parameterized Queries & Logging (#37)
* feat: Add Parameterized Queries - rev version to v0.5 - add additional JDKs * Formatting * Updates * Upgrade packages * Updates * Fix build * Updates * Fixes * fix: Skip integration tests gracefully when required tables/server unavailable - TpchIntegrationTest: Check for tpch.customer table availability in setUp() - ParameterizedQueryTest: Skip on 'not found' errors in addition to connection errors - FlightQueryTest: Skip tests when API_KEY missing or taxi_trips table unavailable - Allows tests to pass in CI where specific test data may not exist * fix: Use taxi_trips for Spice Cloud parameterized query test - testParameterizedQuerySpiceCloud now uses taxi_trips (available in CI) - TPC-H tests use tpch.* tables (available locally) * refactor: Use explicit Spice Cloud endpoints instead of withSpiceCloud() - FlightQueryTest and ParameterizedQueryTest now use explicit endpoints: - HTTP: https://us-west-2-prod-aws-data.spiceai.io - Flight: https://us-west-2-prod-aws-flight.spiceai.io:443 * Update endpoints * Update .github/ISSUE_TEMPLATE/end_game.md Co-authored-by: Phillip LeBlanc <phillip@leblanc.tech> * fix: use standard Spice Cloud endpoints instead of region-specific URLs Updated FlightQueryTest and ParameterizedQueryTest to use the standard Spice Cloud endpoints (data.spiceai.io and flight.spiceai.io) instead of region-specific URLs (us-east-1-prod-aws-* and us-west-2-prod-aws-*) which were causing 'failed to get spice client' errors. * fix: handle 'Acceleration not ready' errors in CI tests Made exception handling case-insensitive and added null checks for error messages. The tests now skip gracefully when the acceleration is still loading initial data (common in CI environments). --------- Co-authored-by: Phillip LeBlanc <phillip@leblanc.tech>
1 parent a93d833 commit d4620cf

19 files changed

Lines changed: 4880 additions & 179 deletions

.github/ISSUE_TEMPLATE/end_game.md

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: Milestone Endgame
33
about: Ship a milestone!
4-
title: 'v0.x.x endgame'
4+
title: 'vX.Y.Z endgame'
55
labels: 'kind/endgame'
66
assignees: ''
77
---
@@ -20,22 +20,40 @@ assignees: ''
2020

2121
## Release Checklist
2222

23+
### Code & Version Verification
24+
2325
- [ ] All features/bugfixes to be included in the release have been merged to trunk
26+
- [ ] Verify `Version.java` and version in `pom.xml` are correct and match the milestone version
27+
- [ ] Verify version in `README.md` examples (Maven and Gradle) match the milestone version
28+
- [ ] Verify all dependencies are up to date (especially Arrow and ADBC versions)
29+
30+
### Documentation
31+
2432
- [ ] Full test pass and update if necessary over [README.md](https://github.com/spiceai/spice-java/blob/trunk/README.md)
2533
- [ ] Full test pass and update if necessary over Docs
2634
- [ ] [docs.spiceai.org](https://docs.spiceai.org/sdks/java)
2735
- [ ] [docs.spice.ai](https://github.com/spicehq/docs/blob/trunk/sdks/java-sdk.md)
28-
- [ ] Test the [`spice-java` sample](https://github.com/spiceai/samples/tree/trunk/client-sdk/spice-java-sdk-sample) using the latest `trunk` SDK version.
2936
- [ ] Update [release notes](https://github.com/spiceai/spice-java/blob/trunk/docs/release_notes)
30-
- [ ] Ensure any external contributors have been acknowledged.
31-
- [ ] Verify `Version.java` and version in `pom.xml` are correct and match the milestone version.
32-
- [ ] Run [Test CI](https://github.com/spiceai/spice-java/actions/workflows/build.yml) and ensure it is green on the trunk branch.
37+
- [ ] Ensure any external contributors have been acknowledged
38+
39+
### Testing
40+
41+
- [ ] Test the [`spice-java` sample](https://github.com/spiceai/samples/tree/trunk/client-sdk/spice-java-sdk-sample) using the latest `trunk` SDK version
42+
- [ ] Run [Build CI](https://github.com/spiceai/spice-java/actions/workflows/build.yaml) and ensure it is green on the trunk branch
3343
- [ ] QA DRI sign-off
44+
45+
### Release
46+
3447
- [ ] Docs DRI sign-off
35-
- [ ] Create a new branch `release-v[semver]` for the release from trunk. E.g. `release-v0.17.0-beta`
36-
- [ ] Release the new version by creating and publishing a latest [GitHub Release](https://github.com/spiceai/spice-java/releases/new) with the tag from the release branch. E.g. `v0.17.0-beta`.
37-
- [ ] Ensure the [publish](https://github.com/spiceai/spice-java/actions/workflows/publish.yml) workflow has triggered, and successfully published the package.
48+
- [ ] Create a new branch `release-v[semver]` for the release from trunk. E.g. `release-v0.5.0`
49+
- [ ] Release the new version by creating and publishing a latest [GitHub Release](https://github.com/spiceai/spice-java/releases/new) with the tag from the release branch. E.g. `v0.5.0`
50+
- [ ] Ensure the [publish](https://github.com/spiceai/spice-java/actions/workflows/publish.yaml) workflow has triggered, and successfully published the package
3851
- [ ] [Publish](https://central.sonatype.com/publishing) and [verify](https://central.sonatype.com/artifact/ai.spice/spiceai/versions) package in Maven Central Repository
39-
- [ ] Run a test pass using the [`spice-java` sample](https://github.com/spiceai/samples/tree/trunk/client-sdk/spice-java-sdk-sample) using the latest published version.
40-
- [ ] Update `Version.java` and version in `pom.xml` to the next release version.
52+
53+
### Post-Release
54+
55+
- [ ] Run a test pass using the [`spice-java` sample](https://github.com/spiceai/samples/tree/trunk/client-sdk/spice-java-sdk-sample) using the latest published version
56+
- [ ] Update `Version.java` and version in `pom.xml` to the next release version
57+
- [ ] Update `README.md` examples (Maven and Gradle) to the next release version
4158
- [ ] The SDK release is added to the next [Spice release notes](https://github.com/spiceai/spiceai/tree/trunk/docs/release_notes)
59+

.github/workflows/build.yaml

Lines changed: 147 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -11,141 +11,170 @@ jobs:
1111
build_multi_os:
1212
name: Build and test ${{matrix.os}}
1313
runs-on: ${{ matrix.os }}
14+
timeout-minutes: 30
1415
strategy:
1516
fail-fast: false
1617
matrix:
1718
os: [ubuntu-latest, macos-latest, windows-latest]
1819
steps:
19-
- uses: actions/checkout@v4
20-
21-
- name: Set up JDK 17 (Oracle)
22-
uses: actions/setup-java@v4
23-
with:
24-
java-version: 17
25-
distribution: oracle
26-
27-
- name: Display Java version
28-
run: java -version
29-
30-
- name: Display Javac version
31-
run: javac -version
32-
33-
- name: Display Maven version
34-
run: mvn -version
35-
36-
- name: Build (Unix)
37-
if: matrix.os != 'windows-latest'
38-
run: mvn install -DskipTests=true -Dgpg.skip -B -V
39-
40-
- name: Build (Windows)
41-
if: matrix.os == 'windows-latest'
42-
run: mvn --% install -DskipTests=true -Dgpg.skip -B -V # tell powershell to stop parsing with --% so it doesn't error with "Unknown lifecycle phase .skip"
43-
44-
- name: Install Spice (https://install.spiceai.org) (Unix)
45-
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
46-
env:
47-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48-
run: |
49-
curl https://install.spiceai.org | /bin/bash
50-
echo "$HOME/.spice/bin" >> $GITHUB_PATH
51-
$HOME/.spice/bin/spice install
52-
53-
- name: install Spice (Windows)
54-
if: matrix.os == 'windows-latest'
55-
run: |
56-
curl -L "https://install.spiceai.org/Install.ps1" -o Install.ps1 && PowerShell -ExecutionPolicy Bypass -File ./Install.ps1
57-
58-
- name: add Spice bin to PATH (Windows)
59-
if: matrix.os == 'windows-latest'
60-
run: |
61-
Add-Content $env:GITHUB_PATH (Join-Path $HOME ".spice\bin")
62-
shell: pwsh
63-
64-
- name: Init and start spice app (Unix)
65-
if: matrix.os != 'windows-latest'
66-
run: |
67-
spice init spice_qs
68-
cd spice_qs
69-
spice add spiceai/quickstart
70-
spiced &> spice.log &
71-
# time to initialize added dataset
72-
sleep 10
73-
74-
- name: Init and start spice app (Windows)
75-
if: matrix.os == 'windows-latest'
76-
run: |
77-
spice init spice_qs
78-
cd spice_qs
79-
spice add spiceai/quickstart
80-
Start-Process -FilePath spice run
81-
# time to initialize added dataset
82-
Start-Sleep -Seconds 10
83-
shell: pwsh
84-
85-
- name: Test
86-
run: mvn test -B
87-
env:
88-
API_KEY: ${{ secrets.SPICE_CLOUD_QUICKSTART_API_KEY }}
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up JDK 17 (Oracle)
23+
uses: actions/setup-java@v4
24+
with:
25+
java-version: 17
26+
distribution: oracle
27+
cache: maven
28+
29+
- name: Display Java version
30+
run: java -version
31+
32+
- name: Display Javac version
33+
run: javac -version
34+
35+
- name: Display Maven version
36+
run: mvn -version
37+
38+
- name: Build (Unix)
39+
if: matrix.os != 'windows-latest'
40+
run: mvn install -DskipTests=true -Dgpg.skip -B -V
41+
42+
- name: Build (Windows)
43+
if: matrix.os == 'windows-latest'
44+
run: mvn --% install -DskipTests=true -Dgpg.skip -B -V # tell powershell to stop parsing with --% so it doesn't error with "Unknown lifecycle phase .skip"
45+
46+
- name: Install Spice (https://install.spiceai.org) (Unix)
47+
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
run: |
51+
curl https://install.spiceai.org | /bin/bash
52+
echo "$HOME/.spice/bin" >> $GITHUB_PATH
53+
$HOME/.spice/bin/spice install
54+
55+
- name: install Spice (Windows)
56+
if: matrix.os == 'windows-latest'
57+
run: |
58+
curl -L "https://install.spiceai.org/Install.ps1" -o Install.ps1 && PowerShell -ExecutionPolicy Bypass -File ./Install.ps1
59+
60+
- name: add Spice bin to PATH (Windows)
61+
if: matrix.os == 'windows-latest'
62+
run: |
63+
Add-Content $env:GITHUB_PATH (Join-Path $HOME ".spice\bin")
64+
shell: pwsh
65+
66+
- name: Init and start spice app (Unix)
67+
if: matrix.os != 'windows-latest'
68+
run: |
69+
spice init spice_qs
70+
cd spice_qs
71+
spice add spiceai/quickstart
72+
spiced &> spice.log &
73+
# time to initialize added dataset
74+
sleep 10
75+
76+
- name: Init and start spice app (Windows)
77+
if: matrix.os == 'windows-latest'
78+
run: |
79+
spice init spice_qs
80+
cd spice_qs
81+
spice add spiceai/quickstart
82+
Start-Process -FilePath spice run
83+
# time to initialize added dataset
84+
Start-Sleep -Seconds 10
85+
shell: pwsh
86+
87+
- name: Test
88+
run: mvn test -B
89+
env:
90+
API_KEY: ${{ secrets.SPICE_CLOUD_QUICKSTART_API_KEY }}
91+
92+
- name: Upload test results
93+
if: always()
94+
uses: actions/upload-artifact@v4
95+
with:
96+
name: test-results-${{ matrix.os }}
97+
path: target/surefire-reports/
98+
retention-days: 7
8999

90100
build:
91101
runs-on: ubuntu-latest
102+
timeout-minutes: 20
92103
strategy:
93104
fail-fast: false
94105
matrix:
95106
java:
107+
# Microsoft OpenJDK (LTS versions only)
96108
- version: 11
97-
distribution: microsoft # OpenJDK build by Microsoft
109+
distribution: microsoft
98110
- version: 17
99-
distribution: microsoft # OpenJDK build by Microsoft
111+
distribution: microsoft
100112
- version: 21
101-
distribution: microsoft # OpenJDK build by Microsoft
102-
# setup-java supports Oracle JDS 17 and later
103-
# - version: 11
104-
# distribution: oracle
113+
distribution: microsoft # LTS
114+
# Eclipse Temurin (Adoptium) - LTS and recent non-LTS
115+
- version: 21
116+
distribution: temurin # LTS
117+
- version: 23
118+
distribution: temurin # Non-LTS - released Sept 2024
119+
- version: 24
120+
distribution: temurin # Non-LTS - released March 2025
121+
# Oracle JDK (17 and later only)
105122
- version: 17
106123
distribution: oracle
107124
- version: 21
108-
distribution: oracle
109-
- version: 22
110-
distribution: oracle
125+
distribution: oracle # LTS - support until 2031
126+
- version: 23
127+
distribution: oracle # Non-LTS - released Sept 2024
128+
- version: 24
129+
distribution: oracle # Non-LTS - released March 2025
130+
- version: 25
131+
distribution: oracle # LTS - released Sept 2025, support until 2033
111132

112133
steps:
113-
- uses: actions/checkout@v4
114-
115-
- name: Set up JDK ${{ matrix.java.version }} (${{ matrix.java.distribution }})
116-
uses: actions/setup-java@v4
117-
with:
118-
java-version: ${{ matrix.java.version }}
119-
distribution: ${{ matrix.java.distribution }}
120-
121-
- name: Display Java version
122-
run: java -version
123-
124-
- name: Display Javac version
125-
run: javac -version
126-
127-
- name: Display Maven version
128-
run: mvn -version
129-
130-
- name: Build
131-
run: mvn install -DskipTests=true -Dgpg.skip -B -V
132-
133-
- name: Install Spice (https://install.spiceai.org)
134-
run: |
135-
curl https://install.spiceai.org | /bin/bash
136-
echo "$HOME/.spice/bin" >> $GITHUB_PATH
137-
138-
- name: Init and start spice app
139-
run: |
140-
spice init spice_qs
141-
cd spice_qs
142-
spice add spiceai/quickstart
143-
spice run &> spice.log &
144-
# time to initialize added dataset
145-
sleep 10
146-
147-
- name: Test
148-
run: mvn test -B
149-
env:
150-
API_KEY: ${{ secrets.SPICE_CLOUD_QUICKSTART_API_KEY }}
151-
134+
- uses: actions/checkout@v4
135+
136+
- name: Set up JDK ${{ matrix.java.version }} (${{ matrix.java.distribution }})
137+
uses: actions/setup-java@v4
138+
with:
139+
java-version: ${{ matrix.java.version }}
140+
distribution: ${{ matrix.java.distribution }}
141+
cache: maven
142+
143+
- name: Display Java version
144+
run: java -version
145+
146+
- name: Display Javac version
147+
run: javac -version
148+
149+
- name: Display Maven version
150+
run: mvn -version
151+
152+
- name: Build
153+
run: mvn install -DskipTests=true -Dgpg.skip -B -V
154+
155+
- name: Install Spice (https://install.spiceai.org)
156+
run: |
157+
curl https://install.spiceai.org | /bin/bash
158+
echo "$HOME/.spice/bin" >> $GITHUB_PATH
159+
160+
- name: Init and start spice app
161+
run: |
162+
spice init spice_qs
163+
cd spice_qs
164+
spice add spiceai/quickstart
165+
spice run &> spice.log &
166+
# time to initialize added dataset
167+
sleep 10
168+
169+
- name: Test
170+
run: mvn test -B
171+
env:
172+
API_KEY: ${{ secrets.SPICE_CLOUD_QUICKSTART_API_KEY }}
173+
174+
- name: Upload test results
175+
if: always()
176+
uses: actions/upload-artifact@v4
177+
with:
178+
name: test-results-jdk${{ matrix.java.version }}-${{ matrix.java.distribution }}
179+
path: target/surefire-reports/
180+
retention-days: 7

.github/workflows/publish.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
jobs:
1010
publish:
1111
runs-on: ubuntu-latest
12+
timeout-minutes: 15
13+
environment: production
1214

1315
steps:
1416
- name: Checkout code
@@ -21,15 +23,29 @@ jobs:
2123
java-version: 17
2224
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
2325
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
26+
cache: maven
27+
28+
- name: Verify version consistency
29+
run: |
30+
POM_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
31+
JAVA_VERSION=$(grep -oP 'SPICE_JAVA_VERSION = "\K[^"]+' src/main/java/ai/spice/Version.java)
32+
echo "pom.xml version: $POM_VERSION"
33+
echo "Version.java version: $JAVA_VERSION"
34+
if [ "$POM_VERSION" != "$JAVA_VERSION" ]; then
35+
echo "ERROR: Version mismatch between pom.xml ($POM_VERSION) and Version.java ($JAVA_VERSION)"
36+
exit 1
37+
fi
2438
2539
- name: Build
2640
run: make build
2741

42+
- name: Run tests
43+
run: make test
44+
2845
- name: Publish to Maven Central
2946
env:
3047
GPG_KEYNAME: ${{ secrets.GPG_KEYNAME }}
3148
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
3249
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
3350
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
3451
run: make publish
35-

0 commit comments

Comments
 (0)