https://github.com/spiceai/gospice
Import the package:
Create a SpiceClient using default configuration:
SpiceClient
Or pass custom flight address:
Execute a query and get back an Apache Arrow Reader:
go get github.com/spiceai/gospice/v6
import "github.com/spiceai/gospice/v6"
spice := NewSpiceClient()defer spice.Close()
if err := spice.Init( spice.WithFlightAddress("grpc://my_remote_spice_instance:50051")); err != nil { panic(fmt.Errorf("error initializing SpiceClient: %w", err))}
reader, err := spice.Query( context.Background(), "SELECT trip_distance, total_amount FROM taxi_trips ORDER BY trip_distance DESC LIMIT 10;")if err != nil { panic(fmt.Errorf("error querying: %w", err))}defer reader.Release()