Skip to content

Commit

Permalink
🎉 BigQuery destination mlp (#11238)
Browse files Browse the repository at this point in the history
* fix bug with anyOf and allOf json blocks

* updated spec and documentation

* rollback last changes

* updated spec

* updated spec

* updated bigquery permissions in doc

* updated spec

* updated spec

* updated spec

* updated tests

* fixed remarks

* updated tests

* updated tests

* added new bigquery version

* updated spec

* updated version

* updated definitions
  • Loading branch information
andriikorotkov authored Mar 23, 2022
1 parent 656ccd5 commit 8771ba9
Show file tree
Hide file tree
Showing 5 changed files with 153 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- name: BigQuery
destinationDefinitionId: 22f6c74f-5699-40ff-833c-4a879ea40133
dockerRepository: airbyte/destination-bigquery
dockerImageTag: 0.6.12
dockerImageTag: 1.0.0
documentationUrl: https://docs.airbyte.io/integrations/destinations/bigquery
icon: bigquery.svg
resourceRequirements:
Expand Down
67 changes: 41 additions & 26 deletions airbyte-config/init/src/main/resources/seed/destination_specs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
supportsDBT: false
supported_destination_sync_modes:
- "append"
- dockerImage: "airbyte/destination-bigquery:0.6.12"
- dockerImage: "airbyte/destination-bigquery:1.0.0"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/destinations/bigquery"
connectionSpecification:
Expand All @@ -201,14 +201,13 @@
additionalProperties: true
properties:
big_query_client_buffer_size_mb:
title: "Google BigQuery client chunk size"
description: "Google BigQuery client's chunk(buffer) size (MIN=1, MAX =\
title: "Google BigQuery Client Chunk Size (Optional)"
description: "Google BigQuery client's chunk (buffer) size (MIN=1, MAX =\
\ 15) for each table. The size that will be written by a single RPC. Written\
\ data will be buffered and only flushed upon reaching this size or closing\
\ the channel. The default 15MiB value is used if not set explicitly.\
\ It's recommended to decrease value for big data sets migration for less\
\ HEAP memory consumption and avoiding crashes. For more details refer\
\ to https://googleapis.dev/python/bigquery/latest/generated/google.cloud.bigquery.client.Client.html"
\ the channel. The default 15MB value is used if not set explicitly. Read\
\ more <a href=\"https://googleapis.dev/python/bigquery/latest/generated/google.cloud.bigquery.client.Client.html\"\
>here</a>."
type: "integer"
minimum: 1
maximum: 15
Expand All @@ -218,18 +217,22 @@
project_id:
type: "string"
description: "The GCP project ID for the project containing the target BigQuery\
\ dataset."
\ dataset. Read more <a href=\"https://cloud.google.com/iam/docs/creating-managing-service-accounts#creating\"\
>here</a>."
title: "Project ID"
dataset_id:
type: "string"
description: "Default BigQuery Dataset ID tables are replicated to if the\
\ source does not specify a namespace."
description: "The default BigQuery Dataset ID that tables are replicated\
\ to if the source does not specify a namespace. Read more <a href=\"\
https://cloud.google.com/bigquery/docs/datasets#create-dataset\">here</a>."
title: "Default Dataset ID"
dataset_location:
type: "string"
description: "The location of the dataset. Warning: Changes made after creation\
\ will not be applied."
title: "Dataset Location"
\ will not be applied. The default \"US\" value is used if not set explicitly.\
\ Read more <a href=\"https://cloud.google.com/bigquery/docs/locations\"\
>here</a>."
title: "Dataset Location (Optional)"
default: "US"
enum:
- "US"
Expand Down Expand Up @@ -266,20 +269,22 @@
credentials_json:
type: "string"
description: "The contents of the JSON service account key. Check out the\
\ <a href=\"https://docs.airbyte.io/integrations/destinations/bigquery\"\
\ <a href=\"https://docs.airbyte.com/integrations/destinations/bigquery#service-account-key\"\
>docs</a> if you need help generating this key. Default credentials will\
\ be used if this field is left empty."
title: "Credentials JSON"
title: "Credentials JSON (Optional)"
airbyte_secret: true
transformation_priority:
type: "string"
description: "Interactive run type means that the query is executed as soon\
\ as possible, and these queries count towards concurrent rate limit and\
\ daily limit. Batch queries are queued and started as soon as idle resources\
\ daily limit. Read more about interactive run type <a href=\"https://cloud.google.com/bigquery/docs/running-queries#queries\"\
>here</a>. Batch queries are queued and started as soon as idle resources\
\ are available in the BigQuery shared resource pool, which usually occurs\
\ within a few minutes. Batch queries don’t count towards your concurrent\
\ rate limit."
title: "Transformation Query Run Type"
\ rate limit. Read more about batch queries <a href=\"https://cloud.google.com/bigquery/docs/running-queries#batch\"\
>here</a>. The default \"interactive\" value is used if not set explicitly."
title: "Transformation Query Run Type (Optional)"
default: "interactive"
enum:
- "interactive"
Expand All @@ -288,11 +293,17 @@
type: "object"
title: "Loading Method"
description: "Loading method used to send select the way data will be uploaded\
\ to BigQuery."
\ to BigQuery. <br><b>Standard Inserts</b> - Direct uploading using SQL\
\ INSERT statements. This method is extremely inefficient and provided\
\ only for quick testing. In almost all cases, you should use staging.\
\ <br><b>GCS Staging</b> - Writes large batches of records to a file,\
\ uploads the file to GCS, then uses <b>COPY INTO table</b> to upload\
\ the file. Recommended for most workloads for better speed and scalability.\
\ Read more about GCS Staging <a href=\"https://docs.airbyte.com/integrations/destinations/bigquery#gcs-staging\"\
>here</a>."
oneOf:
- title: "Standard Inserts"
additionalProperties: false
description: "Direct uploading using streams."
required:
- "method"
properties:
Expand All @@ -301,9 +312,6 @@
const: "Standard"
- title: "GCS Staging"
additionalProperties: false
description: "Writes large batches of records to a file, uploads the file\
\ to GCS, then uses <pre>COPY INTO table</pre> to upload the file. Recommended\
\ for large production workloads for better speed and scalability."
required:
- "method"
- "gcs_bucket_name"
Expand All @@ -316,16 +324,18 @@
gcs_bucket_name:
title: "GCS Bucket Name"
type: "string"
description: "The name of the GCS bucket."
description: "The name of the GCS bucket. Read more <a href=\"https://cloud.google.com/storage/docs/naming-buckets\"\
>here</a>."
examples:
- "airbyte_sync"
gcs_bucket_path:
title: "GCS Bucket Path"
description: "Directory under the GCS bucket where data will be written."
type: "string"
examples:
- "data_sync/test"
part_size_mb:
title: "Block Size (MB) for GCS multipart upload"
title: "Block Size (MB) for GCS Multipart Upload (Optional)"
description: "This is the size of a \"Part\" being buffered in memory.\
\ It limits the memory usage when writing. Larger values will allow\
\ to upload a bigger files and improve the speed, but consumes more\
Expand All @@ -340,14 +350,19 @@
type: "string"
description: "This upload method is supposed to temporary store records\
\ in GCS bucket. What do you want to do with data in GCS bucket\
\ when migration has finished?"
title: "GCS tmp files afterward processing"
\ when migration has finished? The default \"Delete all tmp files\
\ from GCS\" value is used if not set explicitly."
title: "GCS Tmp Files Afterward Processing (Optional)"
default: "Delete all tmp files from GCS"
enum:
- "Delete all tmp files from GCS"
- "Keep all tmp files in GCS"
credential:
title: "Credential"
description: "An HMAC key is a type of credential and can be associated\
\ with a service account or a user account in Cloud Storage. Read\
\ more <a href=\"https://cloud.google.com/storage/docs/authentication/hmackeys\"\
>here</a>."
type: "object"
oneOf:
- title: "HMAC key"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ ENV ENABLE_SENTRY true

COPY --from=build /airbyte /airbyte

LABEL io.airbyte.version=0.6.12
LABEL io.airbyte.version=1.0.0
LABEL io.airbyte.name=airbyte/destination-bigquery
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"additionalProperties": true,
"properties": {
"big_query_client_buffer_size_mb": {
"title": "Google BigQuery client chunk size",
"description": "Google BigQuery client's chunk(buffer) size (MIN=1, MAX = 15) for each table. The size that will be written by a single RPC. Written data will be buffered and only flushed upon reaching this size or closing the channel. The default 15MiB value is used if not set explicitly. It's recommended to decrease value for big data sets migration for less HEAP memory consumption and avoiding crashes. For more details refer to https://googleapis.dev/python/bigquery/latest/generated/google.cloud.bigquery.client.Client.html",
"title": "Google BigQuery Client Chunk Size (Optional)",
"description": "Google BigQuery client's chunk (buffer) size (MIN=1, MAX = 15) for each table. The size that will be written by a single RPC. Written data will be buffered and only flushed upon reaching this size or closing the channel. The default 15MB value is used if not set explicitly. Read more <a href=\"https://googleapis.dev/python/bigquery/latest/generated/google.cloud.bigquery.client.Client.html\">here</a>.",
"type": "integer",
"minimum": 1,
"maximum": 15,
Expand All @@ -22,18 +22,18 @@
},
"project_id": {
"type": "string",
"description": "The GCP project ID for the project containing the target BigQuery dataset.",
"description": "The GCP project ID for the project containing the target BigQuery dataset. Read more <a href=\"https://cloud.google.com/iam/docs/creating-managing-service-accounts#creating\">here</a>.",
"title": "Project ID"
},
"dataset_id": {
"type": "string",
"description": "Default BigQuery Dataset ID tables are replicated to if the source does not specify a namespace.",
"description": "The default BigQuery Dataset ID that tables are replicated to if the source does not specify a namespace. Read more <a href=\"https://cloud.google.com/bigquery/docs/datasets#create-dataset\">here</a>.",
"title": "Default Dataset ID"
},
"dataset_location": {
"type": "string",
"description": "The location of the dataset. Warning: Changes made after creation will not be applied.",
"title": "Dataset Location",
"description": "The location of the dataset. Warning: Changes made after creation will not be applied. The default \"US\" value is used if not set explicitly. Read more <a href=\"https://cloud.google.com/bigquery/docs/locations\">here</a>.",
"title": "Dataset Location (Optional)",
"default": "US",
"enum": [
"US",
Expand Down Expand Up @@ -71,26 +71,25 @@
},
"credentials_json": {
"type": "string",
"description": "The contents of the JSON service account key. Check out the <a href=\"https://docs.airbyte.io/integrations/destinations/bigquery\">docs</a> if you need help generating this key. Default credentials will be used if this field is left empty.",
"title": "Credentials JSON",
"description": "The contents of the JSON service account key. Check out the <a href=\"https://docs.airbyte.com/integrations/destinations/bigquery#service-account-key\">docs</a> if you need help generating this key. Default credentials will be used if this field is left empty.",
"title": "Credentials JSON (Optional)",
"airbyte_secret": true
},
"transformation_priority": {
"type": "string",
"description": "Interactive run type means that the query is executed as soon as possible, and these queries count towards concurrent rate limit and daily limit. Batch queries are queued and started as soon as idle resources are available in the BigQuery shared resource pool, which usually occurs within a few minutes. Batch queries don’t count towards your concurrent rate limit.",
"title": "Transformation Query Run Type",
"description": "Interactive run type means that the query is executed as soon as possible, and these queries count towards concurrent rate limit and daily limit. Read more about interactive run type <a href=\"https://cloud.google.com/bigquery/docs/running-queries#queries\">here</a>. Batch queries are queued and started as soon as idle resources are available in the BigQuery shared resource pool, which usually occurs within a few minutes. Batch queries don’t count towards your concurrent rate limit. Read more about batch queries <a href=\"https://cloud.google.com/bigquery/docs/running-queries#batch\">here</a>. The default \"interactive\" value is used if not set explicitly.",
"title": "Transformation Query Run Type (Optional)",
"default": "interactive",
"enum": ["interactive", "batch"]
},
"loading_method": {
"type": "object",
"title": "Loading Method",
"description": "Loading method used to send select the way data will be uploaded to BigQuery.",
"description": "Loading method used to send select the way data will be uploaded to BigQuery. <br><b>Standard Inserts</b> - Direct uploading using SQL INSERT statements. This method is extremely inefficient and provided only for quick testing. In almost all cases, you should use staging. <br><b>GCS Staging</b> - Writes large batches of records to a file, uploads the file to GCS, then uses <b>COPY INTO table</b> to upload the file. Recommended for most workloads for better speed and scalability. Read more about GCS Staging <a href=\"https://docs.airbyte.com/integrations/destinations/bigquery#gcs-staging\">here</a>.",
"oneOf": [
{
"title": "Standard Inserts",
"additionalProperties": false,
"description": "Direct uploading using streams.",
"required": ["method"],
"properties": {
"method": {
Expand All @@ -102,7 +101,6 @@
{
"title": "GCS Staging",
"additionalProperties": false,
"description": "Writes large batches of records to a file, uploads the file to GCS, then uses <pre>COPY INTO table</pre> to upload the file. Recommended for large production workloads for better speed and scalability.",
"required": [
"method",
"gcs_bucket_name",
Expand All @@ -117,16 +115,17 @@
"gcs_bucket_name": {
"title": "GCS Bucket Name",
"type": "string",
"description": "The name of the GCS bucket.",
"description": "The name of the GCS bucket. Read more <a href=\"https://cloud.google.com/storage/docs/naming-buckets\">here</a>.",
"examples": ["airbyte_sync"]
},
"gcs_bucket_path": {
"title": "GCS Bucket Path",
"description": "Directory under the GCS bucket where data will be written.",
"type": "string",
"examples": ["data_sync/test"]
},
"part_size_mb": {
"title": "Block Size (MB) for GCS multipart upload",
"title": "Block Size (MB) for GCS Multipart Upload (Optional)",
"description": "This is the size of a \"Part\" being buffered in memory. It limits the memory usage when writing. Larger values will allow to upload a bigger files and improve the speed, but consumes more memory. Allowed values: min=5MB, max=525MB Default: 5MB.",
"type": "integer",
"default": 5,
Expand All @@ -136,8 +135,8 @@
},
"keep_files_in_gcs-bucket": {
"type": "string",
"description": "This upload method is supposed to temporary store records in GCS bucket. What do you want to do with data in GCS bucket when migration has finished?",
"title": "GCS tmp files afterward processing",
"description": "This upload method is supposed to temporary store records in GCS bucket. What do you want to do with data in GCS bucket when migration has finished? The default \"Delete all tmp files from GCS\" value is used if not set explicitly.",
"title": "GCS Tmp Files Afterward Processing (Optional)",
"default": "Delete all tmp files from GCS",
"enum": [
"Delete all tmp files from GCS",
Expand All @@ -146,6 +145,7 @@
},
"credential": {
"title": "Credential",
"description": "An HMAC key is a type of credential and can be associated with a service account or a user account in Cloud Storage. Read more <a href=\"https://cloud.google.com/storage/docs/authentication/hmackeys\">here</a>.",
"type": "object",
"oneOf": [
{
Expand Down
Loading

0 comments on commit 8771ba9

Please sign in to comment.