dbt-labs / dbt-labs-experimental-features

dbt support for database features which are not yet supported natively in dbt-core
Apache License 2.0
147 stars 43 forks source link

bigquery materialized_view - unable to add descriptions to columns. #38

Closed minhajpasha closed 5 months ago

minhajpasha commented 1 year ago

Hello @jtcohen6 , We are using the given macros to build the materialized views in bigquery.

It's working perfectly when we are running with out schema.yml file path: models/views/customers_view.sql

09:32:32 1 of 1 START materialized_view model dataset_views.customers_view ...... [RUN] 09:32:33 1 of 1 OK created materialized_view model dataset_views.customers_view . [OK in 0.89s] 09:32:33
09:32:33 Finished running 1 materialized_view model in 0 hours 0 minutes and 4.66 seconds (4.66s). 09:32:33
09:32:33 Completed successfully 09:32:33
09:32:33 Done. PASS=1 WARN=0 ERROR=0 SKIP=0 TOTAL=1

path:models/views/schema.yml version: 2

models:

When i add the schema.yml (as above) to add descriptions to materialized views it fails with below error: I can see the MV for the model is getting created , but while adding descriptions to mv it's failing

09:28:51 Finished running 1 materialized_view model in 0 hours 0 minutes and 4.20 seconds (4.20s). 09:28:51
09:28:51 Completed with 1 error and 0 warnings: 09:28:51
09:28:51 400 PATCH https://bigquery.googleapis.com/bigquery/v2/projects/uk-gcp-dev/datasets/dataset_views/tables/customers_view?prettyPrint=false: Schema update for materialized views is not supported. 09:28:51
09:28:51 Done. PASS=0 WARN=0 ERROR=1 SKIP=0 TOTAL=1

dataders commented 5 months ago

AFAICT, column descriptions are supported in the official implementation of Big Query materialized views

Materialized Views have been supported in dbt since dbt-core 1.7 (November 2023). See dbt docs: materialized views and dbt docs: Big Query configurations: materialized views for more information.

The version of materialized views in this experimental repo is is long-overdue for official deprecation -- it has not been meaningfully maintained or improved for over three years (see https://github.com/dbt-labs/dbt-labs-experimental-features/pull/11).

If you haven't already, you should try out the official implementation! Should you encounter an issue, you can then open bug or enhancement ticket on either dbt-core or the dbt-bigquery for your current data platform.