TobikoData / sqlmesh

Efficient data transformation and modeling framework that is backwards compatible with dbt.
https://sqlmesh.com
Apache License 2.0
1.65k stars 147 forks source link

Converting an `INCREMENTAL_BY_TIME` model to a `VIEW` model as a forward-only plan fails in BigQuery #3196

Open plaflamme opened 1 day ago

plaflamme commented 1 day ago

The generated query from sqlmesh is something like

CREATE OR REPLACE VIEW ...

But BigQuery fails with the following error:

<table_snapshot_id> is not allowed for this operation because it is currently a TABLE.

So because the physical table is a TABLE (not a view), you cannot use CREATE OR REPLACE VIEW (you could only use CREATE OR REPLACE TABLE).

izeigerman commented 1 day ago

Model kind changes should be categorized as BREAKING even if it's a forward-only plan.