
Google Cloud Query
CertifiedExecute a Spanner SQL query
Google Cloud Query
Execute a Spanner SQL query
Queries database tables and exposes results downstream or dumps to internal storage.
type: io.kestra.plugin.gcp.spanner.QueryExamples
Query a Spanner table and store results
id: spanner_query
namespace: company.team
inputs:
- id: department
type: STRING
defaults: engineering
tasks:
- id: query
type: io.kestra.plugin.gcp.spanner.Query
projectId: "{{ secret('GCP_PROJECT_ID') }}"
instanceId: my-instance
databaseId: my-database
sql: "SELECT * FROM users WHERE department = @department"
parameters:
department: "{{ inputs.department }}"
fetchType: STORE
Properties
databaseId *Requiredstring
The Spanner database ID
instanceId *Requiredstring
The Spanner instance ID
projectId *Requiredstring
The GCP project ID
sql *Requiredstring
The SQL query to execute
emulatorHost string
Spanner emulator host (host: port), for local testing only
When set, the task connects to a local Spanner emulator instead of the real Spanner service.
fetchType string
NONESTOREFETCHFETCH_ONENONEResult handling mode
impersonatedServiceAccount string
The GCP service account to impersonate
parameters object
Query parameters
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
scopes array
The GCP scopes to be used
serviceAccount string
The GCP service account
Outputs
row object
Map containing the first row of fetched data
rows array
List containing the fetched data
size integer
The size of the rows fetch
uri string
uriThe URI of stored result