Skip to content

v3.0

Latest

Choose a tag to compare

@ewgenius ewgenius released this 22 Jul 13:23
b43325f

Announcing spice-rs v3.0 πŸŽ‰

The v3.0 release optimizes the Spice client API, adds support for robust query retry, and supports more custom metadata configurations for spice query.

What's New in v3.0.0

Immutable client API: Client::query() now takes &self instead of &mut self, user can issue multiple simultaneous queries without mutable borrowing.

Automatic query retry: Support automatic query retry on transient network or server-side error when obtaining the result stream in Client::query().

Retryable query stream: Introducing RetryableQueryStream as the returned type of Client::query(). This feature provides robust retry of network interruptions during data streaming.

When a connection is reset during streaming, the stream consumer has two options:

  • Option 1: Retry Query Stream
// When stream consumer continue polling after a ConnectionReset error:
// 1. The query is automatically reissued
// 2. Data streaming restarts from the beginning

// Example flow:
Poll 1: βœ… Received batch1
Poll 2: βœ… Received batch2
Poll 3: ❌ SpiceClientError::ConnectionReset error β†’ Continue polling
Poll 4: βœ… Received batch1* (query restarted automatically)
Poll 5: βœ… Received batch2*
Poll 6: βœ… Received batch3*
...
  • Option 2: Stop polling
// Stream consumer can stop polling when it receives a ConnectionReset error
// The stream won't be retried

// Example flow:
Poll 1: βœ… Received batch1
Poll 2: βœ… Received batch2
Poll 3: ❌ SpiceClientError::ConnectionReset  error β†’ Stop polling and handle error

Expanded support for query parameters: Support custom User-Agent and Cache-Control query metadata configurations.

Follow the Spice OSS quickstart to install and run the spice runtime locally, and query data using the spice-rs SDK:

use spiceai::ClientBuilder;

#[tokio::main]
async fn main() {
  let client = ClientBuilder::new().build().await.unwrap();

  let data = client.query(
    "SELECT trip_distance, total_amount FROM taxi_trips ORDER BY trip_distance DESC LIMIT 10;"
  ).await;
}

Contributors

Breaking Changes

  • Client::query() now takes &self instead of &mut self, and returns a retryable stream type RetryableQueryStream
// Old:
fn query(&mut self, sql: &str) -> FlightRecordBatchStream
// New:
fn query(&self, sql: &str) -> RetryableQueryStream

What's Changed

Full Changelog: v2.0.0...v3.0.0