-
Notifications
You must be signed in to change notification settings - Fork 1
release: prepare v0.8.0 #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+39
−3
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
cd0e24c
release: prepare v0.8.0
krinart 3a04dca
Merge remote-tracking branch 'origin/trunk' into release/v0.8.0
krinart d75be35
docs: reflect that #54 (search) and #55 (nsql) have merged
krinart e1720d0
docs: scope v0.8.0 to search + nsql only
krinart ea3e166
Update release notes for v0.8.0
krinart 2ff04f8
Update release notes for v0.8.0
krinart e7afcc0
Update release notes for v0.8.0
krinart cf4f387
Change japicmp.oldVersion from 0.6.0 to 0.7.0
krinart File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| # Spice Java SDK v0.8.0 | ||
|
|
||
| ## Highlights | ||
|
|
||
| v0.8.0 is a **feature-parity release**, closing the four gaps between this SDK and its siblings (gospice, spice-rs, spicepy, spice.js): search, natural-language-to-SQL, active-query management, and asynchronous queries. All four are purely additive — no existing public API changes shape or behavior, and no dependency changes. | ||
|
|
||
| Unlike gospice and spice-rs, which made their async-query addition a breaking change (repurposing `Query`/`QueryWithParams` to submit asynchronously), this SDK adds it as new, separate methods — `queryAsync`/`queryAsyncWithParams` — so `query()`/`queryWithParams()` keep their existing synchronous, streaming behavior unchanged. This SDK enforces binary/source API compatibility via a `japicmp` CI gate; a rename would have broken it deliberately, and there was no forcing reason (like Go's module-path major-version rule) to accept that cost here. | ||
|
|
||
| ## What's New | ||
|
|
||
| ### 🔎 Search | ||
|
|
||
| `search()` finds documents similar to a piece of text via the runtime's `/v1/search` endpoint (vector, keyword, and hybrid search), for datasets with an embedding column and a loaded embedding model. | ||
|
|
||
| ```java | ||
| SearchResponse response = client.search( | ||
| new SearchRequest("delayed flights to Seattle") | ||
| .withDatasets(List.of("flight_reviews")) | ||
| .withLimit(5)); | ||
|
|
||
| for (SearchMatch match : response.getResults()) { | ||
| System.out.println(match.getDataset() + ": " + match.getScore()); | ||
| } | ||
| ``` | ||
|
|
||
| ### 🗣️ Natural Language to SQL (Nsql) | ||
|
|
||
| `nsql()` translates a natural-language query into SQL via the runtime's configured LLM and runs it, returning the rows alongside the generated SQL. `nsqlGenerateSql()` generates the SQL without running it — inspect or edit it, or run it through `query()`/`queryWithParams()` for Arrow-typed results instead of `nsql()`'s decoded JSON rows. | ||
|
|
||
| ```java | ||
| NsqlResponse response = client.nsql(new NsqlRequest("how many trips were over 10 miles?")); | ||
| System.out.println(response.getSql()); | ||
| System.out.println(response.getData()); | ||
|
|
||
| String sql = client.nsqlGenerateSql(new NsqlRequest("how many trips were over 10 miles?")); | ||
| ``` | ||
|
|
||
| ### 📋 Active Query Management | ||
|
|
||
| `listActiveQueries()` lists the synchronous queries currently running on the runtime, and `cancelActiveQuery(queryId)` cancels one — the runtime doesn't hand a query's ID back to the client that submitted it, so listing is the only way to discover the ID cancellation needs. | ||
|
|
||
| ```java | ||
| for (ActiveQuery query : client.listActiveQueries()) { | ||
| System.out.printf("%s %s %s%n", query.getQueryId(), query.getProtocol(), query.getSqlPreview()); | ||
| } | ||
|
|
||
| client.cancelActiveQuery(queryId); | ||
| ``` | ||
|
|
||
| Both calls are scoped to the authenticated API key or client certificate, not to the `SpiceClient` instance, and reach only the one runtime process behind the client's HTTP endpoint. Runtime releases up to and including v2.1.5 don't scope either endpoint by credential at all. | ||
|
|
||
| ### ⏳ Async Queries | ||
|
|
||
| `queryAsync(sql)` / `queryAsyncWithParams(sql, params...)` submit a query for asynchronous execution and return an `AsyncQuery` handle, requiring the runtime to be running in distributed/scheduler mode. Use the existing `query()`/`queryWithParams()` for the normal synchronous, streaming path. | ||
|
|
||
| ```java | ||
| AsyncQuery job = client.queryAsync("SELECT * FROM large_table"); | ||
| ArrowReader results = job.results(); // waits for completion, then streams results | ||
|
|
||
|
krinart marked this conversation as resolved.
Outdated
|
||
| // Or poll manually: | ||
| QueryStatus status = job.status(); | ||
| job.waitForCompletion(Duration.ofMinutes(5)); | ||
| job.cancel(); | ||
| ``` | ||
|
|
||
| ## Testing | ||
|
|
||
| - New unit test suites (`SearchTest`, `NsqlTest`, `ActiveQueriesTest`, `AsyncQueryTest`) covering request/response shape, validation, error handling, and — for async queries — multi-chunk result pagination and the empty-result edge case, all against local mock servers with no live runtime required. | ||
| - `TestFlightSqlServer` gained `DoAction` support for the four async-query actions, additive to its existing Flight SQL mocking. | ||
|
|
||
| ## Compatibility | ||
|
|
||
| - Public API unchanged: all four features are new methods; nothing existing was renamed, removed, or retyped. | ||
| - No new dependencies. | ||
|
|
||
| ## Release status | ||
|
|
||
| This release is not yet cut. It depends on four open PRs merging first: | ||
|
|
||
| - [#53](https://github.com/spiceai/spice-java/pull/53) — `listActiveQueries()`/`cancelActiveQuery()` | ||
| - [#54](https://github.com/spiceai/spice-java/pull/54) — `search()` | ||
| - [#55](https://github.com/spiceai/spice-java/pull/55) — `nsql()`/`nsqlGenerateSql()` | ||
| - [#56](https://github.com/spiceai/spice-java/pull/56) — `queryAsync()`/`queryAsyncWithParams()` | ||
|
|
||
| It's also worth resolving before or alongside this release: **v0.7.0 was tagged and GitHub-released but was never actually published to Maven Central** — the Sonatype deployment was staged and validated but never taken out of "pending manual publish" (`maven-metadata.xml` on Maven Central still lists `0.6.0` as `<latest>`). `pom.xml`'s `japicmp.oldVersion` is deliberately left at `0.6.0` rather than bumped to `0.7.0` for this reason — see the comment in `pom.xml` for detail. | ||
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.