Tomme / dbt-athena

The athena adapter plugin for dbt (https://getdbt.com)
Apache License 2.0
140 stars 79 forks source link

Remove failing `alter table` when creating a view #63

Closed daniel-cortez-stevenson closed 2 years ago

daniel-cortez-stevenson commented 2 years ago

The alter table statement can not be executed on a view. It will fail with the runtime error, FAILED: SemanticException [Error 10131]: To alter a view you need to use the ALTER VIEW command..

There is no documentation for alter view, and if you run a query like alter view "db.view" set tblproperties ('classification' = 'view'), it will fail with the syntax error, line 1:7: mismatched input 'view'. Expecting: 'SCHEMA', 'TABLE'.

Everything appears to work just fine when this alter table statement is not run, therefore I've removed the macro, which executes the alter table statement from the view creation macro.

Tomme commented 2 years ago

Good catch and thanks!