Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BigQuery: Error querying from a view

I'm receiving this error when querying a view:

A view from this query references an old version of a table that might be incompatible. Please delete and re-create [myDataset.myTestView].

I created the view yesterday, and I'm certain that the table structure has not changed, ie no new columns, no columns were deleted and so on. However, the table was actually dropped and re-created nightly. Is this the cause of my problem?

How should/can I overcome this?

like image 699
Mariatta Avatar asked May 31 '26 08:05

Mariatta


1 Answers

BigQuery saves the internal name of your table in the view. When you delete a table and recreate it, the internal name changes, even if the external name is the same. Note that this is deliberate, so that you don't actually refer to the wrong table, or a table that has a different schema.

If you delete a table that is referenced in a view, you will need to update the view to point at the table. An empty patch operation should suffice, however.

like image 159
Jordan Tigani Avatar answered Jun 02 '26 19:06

Jordan Tigani



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!