Query
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
SubTypestring
createDisposition string
Possible Values
CREATE_IF_NEEDEDCREATE_NEVERdefaultDataset string
destinationTable string
dryRun booleanstring
Default
falsefetchType string
Default
NONEPossible Values
STOREFETCHFETCH_ONENONEflattenResults booleanstring
Default
trueimpersonatedServiceAccount string
jobTimeout string
Format
durationlabels object
SubTypestring
legacySql booleanstring
Default
falselocation string
maxResults integerstring
maximumBillingTier integerstring
maximumBytesBilled integerstring
priority string
Default
INTERACTIVEPossible Values
INTERACTIVEBATCHprojectId string
rangePartitioningEnd integerstring
rangePartitioningField string
rangePartitioningInterval integerstring
rangePartitioningStart integerstring
retryAuto Non-dynamic
Definitions
io.kestra.core.models.tasks.retrys.Constant
interval*Requiredstring
Format
durationtype*Requiredobject
behaviorstring
Default
RETRY_FAILED_TASKPossible Values
RETRY_FAILED_TASKCREATE_NEW_EXECUTIONmaxAttemptsinteger
Minimum
>= 1maxDurationstring
Format
durationwarningOnRetryboolean
Default
falseio.kestra.core.models.tasks.retrys.Exponential
interval*Requiredstring
Format
durationmaxInterval*Requiredstring
Format
durationtype*Requiredobject
behaviorstring
Default
RETRY_FAILED_TASKPossible Values
RETRY_FAILED_TASKCREATE_NEW_EXECUTIONdelayFactornumber
maxAttemptsinteger
Minimum
>= 1maxDurationstring
Format
durationwarningOnRetryboolean
Default
falseio.kestra.core.models.tasks.retrys.Random
maxInterval*Requiredstring
Format
durationminInterval*Requiredstring
Format
durationtype*Requiredobject
behaviorstring
Default
RETRY_FAILED_TASKPossible Values
RETRY_FAILED_TASKCREATE_NEW_EXECUTIONmaxAttemptsinteger
Minimum
>= 1maxDurationstring
Format
durationwarningOnRetryboolean
Default
falseretryMessages array
SubTypestring
Default
["due to concurrent update","Retrying the job may solve the problem","Retrying may solve the problem"]retryReasons array
SubTypestring
Default
["rateLimitExceeded","jobBackendError","backendError","internalError","jobInternalError"]schemaUpdateOptions array
SubTypestring
Possible Values
ALLOW_FIELD_ADDITIONALLOW_FIELD_RELAXATIONscopes array
SubTypestring
Default
["https://www.googleapis.com/auth/cloud-platform"]serviceAccount string
sql string
timePartitioningField string
timePartitioningType string
Default
DAYPossible Values
DAYHOURMONTHYEARuseLegacySql booleanstring
Default
falseuseQueryCache booleanstring
writeDisposition string
Possible Values
WRITE_TRUNCATEWRITE_TRUNCATE_DATAWRITE_APPENDWRITE_EMPTYOutputs
destinationTable
Definitions
io.kestra.plugin.gcp.bigquery.Query-DestinationTable
datasetstring
projectstring
tablestring
jobId string
row object
rows array
SubTypeobject
size integer
uri string
Format
uriMetrics
cache.hit counter
duration timer
estimated.bytes.processed counter
Unit
bytesnum.child.jobs counter
num.dml.affected.rows counter
Unit
recordsreferenced.tables counter
total.bytes.billed counter
Unit
bytestotal.bytes.processed counter
Unit
bytestotal.partitions.processed counter
Unit
partitions