Is it a valid approach when building a dataflow pipeline which aims to store the newest data per key in BigQuery to
- stream-insert the events in a partitioned staging table
- periodically merge (update/insert) into target table, (so that only the newest data to a key is stored in this table). It's a requirement that the merge happens every 2-5 minutes and respects all rows in the staging table.
The idea of this approach is taken from the Google project https://github.com/GoogleCloudPlatform/DataflowTemplates, com.google.cloud.teleport.v2.templates.DataStreamToBigQuery
So far it works okay in our tests, the question here arises from the fact, that Google states in its documentation:
"Rows that were written to a table recently by using streaming (the tabledata.insertall method or the Storage Write API) cannot be modified with UPDATE, DELETE, or MERGE statements." https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language#limitations
Has someone gone this road in a production dataflow pipeline with stable positive results?