dbt-labs / dbt-external-tables

dbt macros to stage external sources
https://hub.getdbt.com/dbt-labs/dbt_external_tables/latest/
Apache License 2.0
286 stars 115 forks source link

Synapse support is broken #305

Open onefloid opened 2 weeks ago

onefloid commented 2 weeks ago

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: https://github.com/dbt-labs/dbt-external-tables/pull/110

After reverting the commit 705a9e48ec24ee49e7bd8e78f7e030ec953200cb and skip the create schema for external tables if not exists from 34c1cc4bbcf28ccb0243807441bf642e801ad158, 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