Google Bigquery
Transfer to Google Bigquery as destination dataset
User can transfer data to Google Bigquery from following sources:
-
SQLITE = "sqlite" BIGQUERY = "bigquery" SNOWFLAKE = "snowflake"
-
LOCAL = "local" GS = "gs" # Google Cloud Storage S3 = "s3" # Amazon S3 SFTP = "sftp"
Following transfer modes are supported:
- Non-native transfer
Following is an example of a non-native transfer between GCS to BigQuery using non-native transfer:
transfer_non_native_gs_to_bigquery = UniversalTransferOperator( task_id="transfer_non_native_gs_to_bigquery", source_dataset=File(path="gs://uto-test/example_uto/homes_main.csv", conn_id="google_cloud_default"), destination_dataset=output_table, )
Examples
- AWS S3 to Google Bigquery transfers
- Non-native transfer
Following is an example of a non-native transfer between AWS S3 to BigQuery using non-native transfer:
transfer_non_native_s3_to_bigquery = UniversalTransferOperator( task_id="transfer_non_native_s3_to_bigquery", source_dataset=File( path="s3://astro-sdk-test/example_uto/csv_files/", conn_id="aws_default", filetype=FileType.CSV ), destination_dataset=Table( name="uto_s3_to_bigquery_destination_table", conn_id="google_cloud_default", metadata=Metadata(schema="astro"), ), )
- GCS to Google Bigquery transfers
- Non-native transfer
Following is an example of a non-native transfer between GCS to BigQuery using non-native transfer:
transfer_non_native_gs_to_bigquery = UniversalTransferOperator( task_id="transfer_non_native_gs_to_bigquery", source_dataset=File(path="gs://uto-test/example_uto/homes_main.csv", conn_id="google_cloud_default"), destination_dataset=output_table, )
Transfer from Google Bigquery as source dataset
User can transfer data from Google BigQuery to the following destination dataset:
-
SQLITE = "sqlite" BIGQUERY = "bigquery" SNOWFLAKE = "snowflake"
-
LOCAL = "local" GS = "gs" # Google Cloud Storage S3 = "s3" # Amazon S3 SFTP = "sftp"
Following transfer modes are supported:
- Transfer using non-native approach
Following is an example of non-native transfers between Bigquery to Snowflake using non-native transfer:
transfer_non_native_bigquery_to_snowflake = UniversalTransferOperator( task_id="transfer_non_native_bigquery_to_snowflake", source_dataset=Table( name="uto_s3_to_bigquery_table", conn_id="google_cloud_default", metadata=Metadata(schema="astro"), ), destination_dataset=Table( name="uto_bigquery_to_snowflake_table", conn_id="snowflake_conn", ), )
Transfer using third-party platform
Examples
- Bigquery to Snowflake transfers
- Non-native transfer
Following is an example of non-native transfers between Bigquery to Snowflake using non-native transfer:
transfer_non_native_bigquery_to_snowflake = UniversalTransferOperator( task_id="transfer_non_native_bigquery_to_snowflake", source_dataset=Table( name="uto_s3_to_bigquery_table", conn_id="google_cloud_default", metadata=Metadata(schema="astro"), ), destination_dataset=Table( name="uto_bigquery_to_snowflake_table", conn_id="snowflake_conn", ), )
- Bigquery to Sqlite transfers
- Non-native transfer
Following is an example of non-native transfers between Bigquery to Sqlite using non-native transfer:
transfer_non_native_bigquery_to_sqlite = UniversalTransferOperator( task_id="transfer_non_native_bigquery_to_sqlite", source_dataset=Table( name="uto_s3_to_bigquery_table", conn_id="google_cloud_default", metadata=Metadata(schema="astro") ), destination_dataset=Table(name="uto_bigquery_to_sqlite_table", conn_id="sqlite_default"), )