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

[CT-522] [Bug] query-comment should append comment for full-refresh and merge statements #140

Closed
mkkuba opened this issue Apr 20, 2022 · 2 comments · Fixed by #153
Closed
Labels
type:bug Something isn't working

Comments

@mkkuba
Copy link

mkkuba commented Apr 20, 2022

Describe the bug

query-comment with append: true set does NOT append the query comment in Snowflake in the following cases:

  • full refresh of a model
  • merge statement on incremental updates

Steps To Reproduce

set query comment config to append: true

query-comment:
    append: true

Run a full refresh of a model
Observe in Snowflake query history that the query-comment is not appended in the query for the full-refresh

Run an incremental update of a model
Observe in Snowflake query history that the query-comment is not appended in the merge statement for the incremental update

Expected behavior

query-comment should be appended to the statements in the cases outlined above

Screenshots and log output

If applicable, add screenshots or log output to help explain your problem.

System information

The output of dbt --version:

installed version: 1.0.1
   latest version: 1.0.4

Your version of dbt is out of date! You can find instructions for upgrading here:
https://docs.getdbt.com/docs/installation

Plugins:
  - snowflake: 1.0.0

The operating system you're using:
MacOS Monterey 12.3.1

The output of python --version:
Python 3.9.9

Additional context

N/A

@mkkuba mkkuba added type:bug Something isn't working triage:product labels Apr 20, 2022
@github-actions github-actions bot changed the title [Bug] query-comment should append comment for full-refresh and merge statements [CT-522] [Bug] query-comment should append comment for full-refresh and merge statements Apr 20, 2022
@jtcohen6
Copy link
Contributor

jtcohen6 commented May 4, 2022

@mkkuba Thanks for opening! You're totally right.

On Snowflake, we need to split up multi-query statements (containing ;), and pass each one as its own query. The issue here has been that query comments are applied before that split happens: the comment is applied in execute, the split occurs in add_query. I think the solution here should be relatively straightforward, possibly even related to the fix for #147.

@mkkuba
Copy link
Author

mkkuba commented Jun 30, 2022

Thanks @jtcohen6 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants