EOL SQL comments remove entire line from execution #2731
Labels
bug
Something isn't working
good_first_issue
Straightforward + self-contained changes, good for new contributors!
snowflake
Milestone
Describe the bug
When using SQL line comment (
-- comment
) at the end of lines and running multiple SQL queries (separated by semicolons) within one statement block, if any one-line query has a line comment after it (on the same line), that command won't be executed (i.e. not submitted to the database at all) - except if it's the first query./* comment */
) do not have this effect (which provides a workaround)This will work (all three queries will be executed):
This will work (all three queries will be executed):
This will not work (only the first query will be executed):
This will work (all three queries will be executed):
Steps To Reproduce
Just put the examples above in a model or macro, and take a look at the queries executed on your database (query log, etc.)
Expected behavior
All three queries should be executed in all examples.
System information
Which database are you using dbt with?
The output of
dbt --version
:The operating system you're using:
The output of
python --version
:The text was updated successfully, but these errors were encountered: