Query
yaml
type: "io.kestra.plugin.gcp.bigquery.query"
Examples
yaml
id: gcp_bq_query
namespace: company.team
tasks:
- id: query
type: io.kestra.plugin.gcp.bigquery.Query
destinationTable: "my_project.my_dataset.my_table"
writeDisposition: WRITE_APPEND
sql: |
SELECT
"hello" as string,
NULL AS `nullable`,
1 as int,
1.25 AS float,
DATE("2008-12-25") AS date,
DATETIME "2008-12-25 15:30:00.123456" AS datetime,
TIME(DATETIME "2008-12-25 15:30:00.123456") AS time,
TIMESTAMP("2008-12-25 15:30:00.123456") AS timestamp,
ST_GEOGPOINT(50.6833, 2.9) AS geopoint,
ARRAY(SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3) AS `array`,
STRUCT(4 AS x, 0 AS y, ARRAY(SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3) AS z) AS `struct`
yaml
id: gcp_bq_query
namespace: company.team
tasks:
- id: fetch
type: io.kestra.plugin.gcp.bigquery.Query
fetch: true
sql: |
SELECT 1 as id, "John" as name
UNION ALL
SELECT 2 as id, "Doe" as name
- id: use_fetched_data
type: io.kestra.plugin.core.debug.Return
format: |
{% for row in outputs.fetch.rows %}
id : {{ row.id }}, name: {{ row.name }}
{% endfor %}
Properties
allowLargeResults booleanstring
clusteringFields array
SubType string
createDisposition string
Possible Values
CREATE_IF_NEEDED
CREATE_NEVER
defaultDataset string
destinationTable string
dryRun booleanstring
Default
false
fetchType string
Default
NONE
Possible Values
STORE
FETCH
FETCH_ONE
NONE
flattenResults booleanstring
Default
true
impersonatedServiceAccount string
jobTimeout string
Format
duration
labels object
SubType string
legacySql booleanstring
Default
false
location string
maxResults integerstring
maximumBillingTier integerstring
maximumBytesBilled integerstring
priority string
Default
INTERACTIVE
Possible Values
INTERACTIVE
BATCH
projectId string
rangePartitioningEnd integerstring
rangePartitioningField string
rangePartitioningInterval integerstring
rangePartitioningStart integerstring
retryAuto Non-dynamicConstantExponentialRandom
retryMessages array
SubType string
Default
["due to concurrent update","Retrying the job may solve the problem","Retrying may solve the problem"]
retryReasons array
SubType string
Default
["rateLimitExceeded","jobBackendError","backendError","internalError","jobInternalError"]
schemaUpdateOptions array
SubType string
Possible Values
ALLOW_FIELD_ADDITION
ALLOW_FIELD_RELAXATION
scopes array
SubType string
Default
["https://www.googleapis.com/auth/cloud-platform"]
serviceAccount string
sql string
timePartitioningField string
timePartitioningType string
Default
DAY
Possible Values
DAY
HOUR
MONTH
YEAR
useLegacySql booleanstring
Default
false
useQueryCache booleanstring
writeDisposition string
Possible Values
WRITE_TRUNCATE
WRITE_TRUNCATE_DATA
WRITE_APPEND
WRITE_EMPTY
Outputs
destinationTable Query-DestinationTable
jobId string
row object
rows array
SubType object
size integer
uri string
Format
uri
Metrics
cache.hit counter
duration timer
estimated.bytes.processed counter
Unit
bytes
num.child.jobs counter
num.dml.affected.rows counter
Unit
records
referenced.tables counter
total.bytes.billed counter
Unit
bytes
total.bytes.processed counter
Unit
bytes
total.partitions.processed counter
Unit
partitions
total.slot.ms counter
Definitions
io.kestra.core.models.tasks.retrys.Constant
interval *Requiredstring
Format
duration
type *Requiredobject
behavior string
Default
RETRY_FAILED_TASK
Possible Values
RETRY_FAILED_TASK
CREATE_NEW_EXECUTION
maxAttempts integer
Minimum
>= 1
maxDuration string
Format
duration
warningOnRetry boolean
Default
false
io.kestra.core.models.tasks.retrys.Random
maxInterval *Requiredstring
Format
duration
minInterval *Requiredstring
Format
duration
type *Requiredobject
behavior string
Default
RETRY_FAILED_TASK
Possible Values
RETRY_FAILED_TASK
CREATE_NEW_EXECUTION
maxAttempts integer
Minimum
>= 1
maxDuration string
Format
duration
warningOnRetry boolean
Default
false
io.kestra.core.models.tasks.retrys.Exponential
interval *Requiredstring
Format
duration
maxInterval *Requiredstring
Format
duration
type *Requiredobject
behavior string
Default
RETRY_FAILED_TASK
Possible Values
RETRY_FAILED_TASK
CREATE_NEW_EXECUTION
delayFactor number
maxAttempts integer
Minimum
>= 1
maxDuration string
Format
duration
warningOnRetry boolean
Default
false