dbt-labs / dbt-labs/dbt-utils

Fabric: generate_source doesn't work due to get_tables_by_pattern_sql

Open
#968 1 comment 0 reactions 0 assignees View on GitHub
bug Stale triage
Dominant language
Makefile
Stars
1.8k
Forks
632
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug
Similar/same to #877, the default `get_tables_by_pattern_sql` macro doesn't work with Fabric.

Instead, it should be:

```
{% macro fabric__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}
select distinct
TABLE_SCHEMA as {{ adapter.quote('table_schema') }},
TABLE_NAME as {{ adapter.quote('table_name') }},
{{ dbt_utils.get_table_types_sql() }}
from
{{ database }}.[INFORMATION_SCHEMA].[TABLES]
where TABLE_CATALOG like '{{ database }}'
and TABLE_TYPE = 'BASE TABLE'
and table_name not like '{{ exclude }}'
{% endmacro %}
```

### Steps to reproduce

### Expected results

### Actual results

### Screenshots and log output

### System information
**The contents of your `packages.yml` file:**

**Which database are you using dbt with?**
- [ ] postgres
- [ ] redshift
- [ ] bigquery
- [ ] snowflake
- [x] other (specify: Fabric)

**The output of `dbt --version`:**
```

```

### Additional context

### Are you interested in contributing the fix?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.