Skip to content

Instantly share code, notes, and snippets.

@aosterloh
Forked from alexvanboxel/medium_agc1_bq3.py
Created January 30, 2017 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aosterloh/1250077cd97399cb4b669667272b4676 to your computer and use it in GitHub Desktop.
Save aosterloh/1250077cd97399cb4b669667272b4676 to your computer and use it in GitHub Desktop.
gcs2bq_avro_with_schema = GoogleCloudStorageToBigQueryOperator(
task_id='gcs2bq_avro_with_schema',
bucket='{{var.value.gcs_bucket}}',
source_objects=[
'path/{{ ds_nodash }}/part-*'
],
destination_project_dataset_table='{{var.value.gcq_tempset}}.avro_with_schema{{ ds_nodash }}',
source_format='AVRO',
schema_fields=schemas.gsob(),
create_disposition='CREATE_IF_NEEDED',
write_disposition='WRITE_TRUNCATE',
google_cloud_storage_conn_id='gcp_smoke',
bigquery_conn_id='gcp_smoke'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment