Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

materialized views create error #1640

Open
arjitshu opened this issue Jan 8, 2024 · 1 comment
Open

materialized views create error #1640

arjitshu opened this issue Jan 8, 2024 · 1 comment

Comments

@arjitshu
Copy link

arjitshu commented Jan 8, 2024

I have created new MV with below dataform code but facing issue while execution of the file.
Although MV created successfully but workflow execution logs showing an error.

config {
   type: "view",
   materialized: true,
   name: "orders_count_by_gender",
   tags: ["orders_count_by_gender"],
   schema: dataform.projectConfig.vars.goldSchema,
   tags: ["orders_count_by_gender" ,"gold"],
   columns: {
       gender: "gender male or female",
       gender_count: "gender count"
   },
   bigquery: {
       additionalOptions: {
           refresh_interval_minutes: "10"
       },
       labels: {
           "type": "reporting"
       }
   }
}
SELECT gender, count(*) as gender_count
FROM ${ref("fact_orders")}
group by gender

Error

Error message Error: googleapi: Error 400: Schema update for materialized views is not supported., invalid
SQL code change did not involved actual schema changes

Screenshot 2024-01-08 at 13 17 31
@BenBirt
Copy link
Collaborator

BenBirt commented Jan 8, 2024

Thanks for filing this issue. I think it's happening because of your columns: ... section in the config block, which Dataform interprets as a table metadata update BigQuery method call - and this is apparently invalid for materialized views.

I have filed an internal issue to make Dataform stop doing this, but for now if you'd like a workaround I would suggest removing columns: ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants