Skip to content

Instantly share code, notes, and snippets.

@alexvanboxel
Last active January 30, 2017 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save alexvanboxel/d3e563a6d0ac67bf0648012f89f6fbd7 to your computer and use it in GitHub Desktop.
Save alexvanboxel/d3e563a6d0ac67bf0648012f89f6fbd7 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