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

Query preview not working for ODBC driver #1456

Open
1 task
tabit01 opened this issue Oct 9, 2024 · 5 comments
Open
1 task

Query preview not working for ODBC driver #1456

tabit01 opened this issue Oct 9, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@tabit01
Copy link

tabit01 commented Oct 9, 2024

Expected behavior

The preview feature should send a valid SQL query to my Fabric Synapse datawarehouse, using the ODBC Driver 18 for SQL Server. Running dbt, debugging, testing works as expected in the warehouse.

Actual behavior

The dispatched query is

select * from <table> limit 500

which is not valid T-SQL

Steps To Reproduce

In settings.json I first tried to set the query template:

"dbt.queryTemplate": "select top {limit} * from ({query}) as query"

I realized that the query template is deprecated, and set the field to blank, reinstalled extension, restarted VS Code etc.

Log output/Screenshots

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

Operating System

Windows 11

dbt version

1.8.7

dbt Adapter

Fabric

dbt Power User version

0.47.0

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@tabit01 tabit01 added the bug Something isn't working label Oct 9, 2024
@pmags
Copy link

pmags commented Oct 9, 2024

Can confirm the same behaviour with dbt-sqlserver and ODBC Driver 17 for SQL Server. This started around Monday. Downgrading to a previous version didn't fix the issue either. Compile works though.

@tabit01 tabit01 changed the title Query template not working Query preview not working for ODBC driver Oct 10, 2024
@tabit01
Copy link
Author

tabit01 commented Oct 11, 2024

Probably relevant DBT Core issue?

dbt-labs/dbt-core#10843

@michrzan
Copy link

I was able to make it work again by downgrading to:
dbt-core 1.7.18
dbt-fabric 1.7.4
on Power User for dbt v0.47.0

@pmags
Copy link

pmags commented Oct 14, 2024

I was able to make it work again by downgrading to: dbt-core 1.7.18 dbt-fabric 1.7.4 on Power User for dbt v0.47.0

I confirm that in my case it also solved the issue. I had tried downgrading but only the dbt-sqlserver library and not the core.

@anandgupta42
Copy link
Contributor

microsoft/dbt-fabric#216

A fix has been pushed for this issue, but a new version has not been released.

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

No branches or pull requests

4 participants