Trigger cloud function when new data in BigQuery

前端 未结 1 1912
青春惊慌失措
青春惊慌失措 2021-02-08 19:29

I would like to trigger a Cloud Function when new data has been imported into a BigQuery table. Ideally, I would like to extract all the rows (one column is ISIN) that have been

1条回答
  •  日久生厌
    2021-02-08 20:10

    Unfortunately BigQuery has no triggers as a native feature as of Jan 2021 :/ However there is a nice workaround you can implement! :)

    As you probably know, almost every operation in GCP is logged to Cloud Logging (previously StackDriver Logging). In this article they demonstrate how to trigger a Cloud Function whenever a BigQuery load job finishes. The idea is simple:

    1. Create a filter for BigQuery load jobs in Cloud Logging to catch when load jobs terminate.
    2. Create a sink from Cloud Logging to Pub/Sub topic.
    3. Set your Cloud Function as a consumer on this topic and implement your logic

    0 讨论(0)
提交回复
热议问题