|
| 1 | +# Announcing spice-rs v3.0 🎉 |
| 2 | + |
| 3 | +The v3.0 release optimizes the Spice client API, adds support for robust query retry, and supports more custom metadata configurations for spice query. |
| 4 | + |
| 5 | +## What's New in v3.0.0 |
| 6 | + |
| 7 | +**Immutable client API**: `Client::query()` now takes `&self` instead of `&mut self`, user can issue multiple simultaneous queries without mutable borrowing. |
| 8 | + |
| 9 | +**Automatic query retry**: Support automatic query retry on transient network or server-side error when obtaining the result stream in `Client::query()`. |
| 10 | + |
| 11 | +**Retryable query stream**: Introducing `RetryableQueryStream` as the returned type of `Client::query()`. This feature provides robust retry of network interruptions during data streaming. |
| 12 | + |
| 13 | +When a connection is reset during streaming, the stream consumer has two options: |
| 14 | + |
| 15 | +- Option 1: Retry Query Stream |
| 16 | + |
| 17 | +```rust |
| 18 | +// When stream consumer continue polling after a ConnectionReset error: |
| 19 | +// 1. The query is automatically reissued |
| 20 | +// 2. Data streaming restarts from the beginning |
| 21 | + |
| 22 | +// Example flow: |
| 23 | +Poll 1: ✅ Received batch1 |
| 24 | +Poll 2: ✅ Received batch2 |
| 25 | +Poll 3: ❌ SpiceClientError::ConnectionReset error → Continue polling |
| 26 | +Poll 4: ✅ Received batch1* (query restarted automatically) |
| 27 | +Poll 5: ✅ Received batch2* |
| 28 | +Poll 6: ✅ Received batch3* |
| 29 | +... |
| 30 | +``` |
| 31 | + |
| 32 | +- Option 2: Stop polling |
| 33 | + |
| 34 | +```rust |
| 35 | +// Stream consumer can stop polling when it receives a ConnectionReset error |
| 36 | +// The stream won't be retried |
| 37 | + |
| 38 | +// Example flow: |
| 39 | +Poll 1: ✅ Received batch1 |
| 40 | +Poll 2: ✅ Received batch2 |
| 41 | +Poll 3: ❌ SpiceClientError::ConnectionReset error → Stop polling and handle error |
| 42 | +``` |
| 43 | + |
| 44 | +**Expanded support for query parameters**: Support custom `User-Agent` and `Cache-Control` query metadata configurations. |
| 45 | + |
| 46 | +Follow the [Spice OSS quickstart](https://github.com/spiceai/spiceai?tab=readme-ov-file#%EF%B8%8F-quickstart-local-machine) to install and run the spice runtime locally, and query data using the spice-rs SDK: |
| 47 | + |
| 48 | +```rust |
| 49 | +use spiceai::ClientBuilder; |
| 50 | + |
| 51 | +#[tokio::main] |
| 52 | +async fn main() { |
| 53 | + let client = ClientBuilder::new().build().await.unwrap(); |
| 54 | + |
| 55 | + let data = client.query( |
| 56 | + "SELECT trip_distance, total_amount FROM taxi_trips ORDER BY trip_distance DESC LIMIT 10;" |
| 57 | + ).await; |
| 58 | +} |
| 59 | +``` |
| 60 | + |
| 61 | +## Contributors |
| 62 | + |
| 63 | +- [@Sevenannn](https://github.com/Sevenannn) |
| 64 | +- [@phillipleblanc](https://github.com/phillipleblanc) |
| 65 | +- [@peasee](https://github.com/peasee) |
| 66 | +- [@digadeesh](https://github.com/digadeesh) |
| 67 | +- [@eadgbear](https://github.com/eadgbear) |
| 68 | + |
| 69 | +## Breaking Changes |
| 70 | + |
| 71 | +- `Client::query()` now takes `&self` instead of `&mut self`, and returns a retryable stream type `RetryableQueryStream` |
| 72 | + |
| 73 | +```rust |
| 74 | +// Old: |
| 75 | +fn query(&mut self, sql: &str) -> FlightRecordBatchStream |
| 76 | +// New: |
| 77 | +fn query(&self, sql: &str) -> RetryableQueryStream |
| 78 | +``` |
| 79 | + |
| 80 | +## What's Changed |
| 81 | + |
| 82 | +- Fix a typo in README.md by @digadeesh in https://github.com/spiceai/spice-rs/pull/42 |
| 83 | +- feat: Add spice user agent, update for clippy rules by @peasee in https://github.com/spiceai/spice-rs/pull/44 |
| 84 | +- Adding custom User-Agent to spice-rs by @eadgbear in https://github.com/spiceai/spice-rs/pull/48 |
| 85 | +- Prepend user-supplied user-agent by @phillipleblanc in https://github.com/spiceai/spice-rs/pull/49 |
| 86 | +- Fix broken system tls loading and test by @Sevenannn in https://github.com/spiceai/spice-rs/pull/52 |
| 87 | +- Support query retry, parameterized query, and cache control header by @Sevenannn in https://github.com/spiceai/spice-rs/pull/51 |
| 88 | +- Enable all tests in CI by @Sevenannn in https://github.com/spiceai/spice-rs/pull/55 |
| 89 | +- feat: Retryable query stream by @Sevenannn in https://github.com/spiceai/spice-rs/pull/57 |
| 90 | +- Fix macos test by @Sevenannn in https://github.com/spiceai/spice-rs/pull/58 |
| 91 | +- docs: Add endgame release process by @peasee in https://github.com/spiceai/spice-rs/pull/46 |
| 92 | + |
| 93 | +**Full Changelog**: https://github.com/spiceai/spice-rs/compare/v2.0.0...v3.0.0 |
0 commit comments