Reputation: 576
What is the best practice for "updating" tables on Google BigQuery?
I get massive batch files that need to be loaded every hour.
Some of the records in the batch files contain records that need to replace the old ones in the big target table.
Upvotes: 3
Views: 1252
Reputation: 59155
If you have an id for each record, you can merge the new table and old table like this:
SELECT * FROM
(SELECT * FROM [oldtable] WHERE id NOT IN (SELECT id FROM [newtable])),
(SELECT * FROM [newtable])
Upvotes: 1