Flight SQL Data Connector
Connect to any Flight SQL compatible server (e.g. Influx 3.0, CnosDB, other Spice runtimes!) as a connector for federated SQL queries.
- from: flightsql:my_catalog.good_schemas.cool_dataset
name: cool_dataset
params:
flightsql_endpoint: http://127.0.0.1:50051
flightsql_username: spicy
flightsql_password: ${secrets:my_flightsql_pass}
params
​
flightsql_endpoint
: The Apache Flight endpoint used to connect to the Flight SQL server.flightsql_username
: Optional. The username to use in the underlying Apache flight Handshake Request to authenticate to the server (see reference).flightsql_password
(optional): The password to use in the underlying Apache flight Handshake Request to authenticate to the server. Use the secret replacement syntax to load the password from a secret store, e.g.${secrets:my_flightsql_pass}
.
Auth Example​
Check Secrets Stores for more details.
- Env
- Kubernetes
- Keyring
MY_USERNAME=<flight_username> \
MY_PASSWORD=<flight_password> \
spice run
.env
MY_USERNAME=<flight_username>
MY_PASSWORD=<flight_password>
spicepod.yaml
version: v1beta1
kind: Spicepod
name: spice-app
secrets:
- from: env
name: env
datasets:
- from: flightsql:my_catalog.good_schemas.cool_dataset
name: cool_dataset
params:
flightsql_endpoint: http://1.2.3.4:50051
flightsql_username: ${env:MY_USERNAME}
flightsql_password: ${env:MY_PASSWORD}
Learn more about Env Secret Store.
kubectl create secret generic flightsql \
--from-literal=username='<flight_username>' \
--from-literal=password='<flight_password>'
spicepod.yaml
version: v1beta1
kind: Spicepod
name: spice-app
secrets:
- from: kubernetes:flightsql
name: flightsql
datasets:
- from: flightsql:my_catalog.good_schemas.cool_dataset
name: cool_dataset
params:
flightsql_endpoint: http://1.2.3.4:50051
flightsql_username: ${flightsql:username}
flightsql_password: ${flightsql:password}
Learn more about Kubernetes Secret Store.
Add new keychain entries (macOS) for the user and password:
# Add Username to keychain
security add-generic-password -l "FlightSQL Username" \
-a spiced -s spice_flightsql_username \
-w <flight_username>
# Add Password to keychain
security add-generic-password -l "FlightSQL Password" \
-a spiced -s spice_flightsql_password \
-w <flight_password>
spicepod.yaml
version: v1beta1
kind: Spicepod
name: spice-app
secrets:
- from: keyring
name: keyring
datasets:
- from: flightsql:my_catalog.good_schemas.cool_dataset
name: cool_dataset
params:
flightsql_endpoint: http://1.2.3.4:50051
flightsql_username: ${keyring:spice_flightsql_username}
flightsql_password: ${keyring:spice_flightsql_password}
Learn more about Keyring Secret Store.