-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
prehook sql throw exception #108
Comments
@hagai-arad hey the issue it's most likely due to this https://github.com/dbt-athena/dbt-athena/blob/main/dbt/adapters/athena/query_headers.py#L19 I will include drop statement in there too. |
@hagai-arad could you try this branch? #109 should fix your issue, I didn't fully tested, but I had something similar with vacuum in the past. |
@nicor88 thanks for the quick fix! I don't have others in mind, but I think any supported command should be available in the pre/post-hook |
why will you run a create command in a pre/post hook? can't you use dbt models for that? |
A few reasons:
|
it should, if not, please create other issues in order to implement
You can use explicit casting to overcome this issue, same for other dbt-adapter
Yes, could be, but I still feel that is wrong to use a |
I totally get your point. |
I wanted to exceute a pre_hook query like this
{{ config(materialized='view',pre_hook="drop table if exists my_first_dbt_model") }}
But I found that in athena , the sql become
-- /* {"app": "dbt", "dbt_version": "1.2.1", "profile_name": "local", "target_name": "dev", "node_id": "model.dbtest.my_first_dbt_model"} */ drop table if exists my_first_dbt_model
since all the sql stay in one line , the sql had been miss as a comment , It failed
The text was updated successfully, but these errors were encountered: