AltimateAI / vscode-dbt-power-user

This extension makes vscode seamlessly work with dbt™: Auto-complete, preview, column lineage, AI docs generation, health checks, cost estimation etc
https://www.altimate.ai
MIT License
459 stars 94 forks source link

Unable to run query which end with a single comment #1279

Open ndeunk opened 3 months ago

ndeunk commented 3 months ago

Expected behavior

Be able to run a query which ends with a single comment

Actual behavior

Incorrect syntax error

Steps To Reproduce

Create simple model. For example:

select * from {{ source('bronze', 'my_test_table') }} -- My new comment

The genereated SQL has an additional statement on the same line as the comment, causing the error.

select * from renamed -- My new comment order by (select null)
    offset 0 rows fetch first 500 rows only

Log output/Screenshots

('42000', "[42000] [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Incorrect syntax near '0'. (102) (SQLExecDirectW)")

Operating System

Debian GNU/Linux 11 (bullseye)

dbt version

1.8.3

dbt Adapter

fabric

dbt Power User version

v0.41.4

Are you willing to submit PR?

mdesmet commented 3 months ago

@ndeunk : Are you able to run this query with dbt show?