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

Synapse support is broken #305

Closed
onefloid opened this issue Jun 19, 2024 · 3 comments · Fixed by #332
Closed

Synapse support is broken #305

onefloid opened this issue Jun 19, 2024 · 3 comments · Fixed by #332
Labels
bug Something isn't working triage

Comments

@onefloid
Copy link

onefloid commented Jun 19, 2024

Describe the bug

I use dbt-synapse and I can't stage the external sources. I always get

  Encountered an error while running operation: Compilation Error in macro stage_external_sources (macros/common/stage_external_sources.sql)
   Staging external sources is not implemented for the default adapter

It seems that the adapter.dispatch() for synapse-dbt does not recognize the sqlserver__ macros.

Potential solution

I have done a little research. The bug was introduced with the following refactoring PR: #110

After reverting the commit 705a9e4 and skip the create schema for external tables if not exists from 34c1cc4, it works for my setup again.

System information

packages.yml file:

packages:
  - package: dbt-labs/dbt_external_tables
    version: 0.9.0

Database: Synapse

dbt version:

Core:
  - installed: 1.8.2
  - latest:    1.8.2 - Up to date!

Plugins:
  - fabric:  1.8.6 - Up to date!
  - synapse: 1.8.0 - Up to date!

OS: Ubuntu 22.04.1 LTS
python: Python 3.10.12

@onefloid onefloid added bug Something isn't working triage labels Jun 19, 2024
@dataders
Copy link
Collaborator

@onefloid recently, dbt-synapse was changed to inherit from dbt-fabric instead of dbt-sqlserver. To remedy this, the macros in the macros/plugins/sqlserver/ directory need to be renamed to have either fabric__ or synapse__ as a prefix instead of sqlserver__.

you can do this today by adding these renamed macros to your own project's macros/ directory.

👁️ @prdpsvs

Copy link

github-actions bot commented Oct 8, 2024

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.

@github-actions github-actions bot added the Stale label Oct 8, 2024
@timomarks
Copy link

timomarks commented Oct 9, 2024

@dataders
Thanks, with your workaround the error vanishes but now I get

 Encountered an error while running operation: Compilation Error
  macro 'dbt_macro__default__dropif' takes not more than 0 argument(s)

  > in macro dropif (macros\common\helpers\dropif.sql)
  > called by macro synapse__get_external_build_plan (macros\get_external_build_plan.sql)
  > called by macro get_external_build_plan (macros\common\get_external_build_plan.sql)
  > called by macro stage_external_sources (macros\stage_external_sources.sql)
  > called by <Unknown>

Edit: After a clean install of all dependencies it now works as intended

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

Successfully merging a pull request may close this issue.

3 participants