0
votes

I am creating a view on a bigQuery Table. The view works fine, until I truncate that table and put new data in it. I get the following error:

"Query Failed Error: A view from this query references an old version of  
a table that might be incompatible. Please delete and re-create 
repcore-dev:views.listings."

If I run the query that defines the view, it works. If I re-create the view with the same query, it works. But my question is why this is necessary. For us the real value in the view is that it provides an abstraction of the table data (even when that data is re-populated).

I'd suggest rather than deleting your old table and creating it again, use the write_truncate create disposition and then the underlying id won't change. The other advantage is that the update will be atomic, so you'll never have a window where your table will be empty.Jordan Tigani