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

Some dbt_utils.get_relations_by_* macros #10

Merged
merged 3 commits into from
Apr 15, 2021
Merged

Conversation

jtcohen6
Copy link
Collaborator

Yes:

  • dbt_utils.get_relations_by_prefix (no support for schema patterns), plus get_tables_by_prefix as alias/passthrough
  • dbt_utils.get_relations_by_pattern (no support for schema patterns), plus get_tables_by_pattern as alias/passthrough

Both are effectively:

show table extended in {{ schema_pattern }} like '{{ table_pattern }}' / '{{ table_prefix }}*'

It needs to be extended in order to derive relation type (view or table).

No:

  • dbt_utils.get_relations_by_prefix_sql
  • dbt_utils.get_relations_by_pattern_sql

This is enough to get us Spark/Databricks compatibility for the codegen package, which uses dbt_utils.get_relations_by_prefix here.

@jtcohen6 jtcohen6 merged commit c380649 into master Apr 15, 2021
@jtcohen6 jtcohen6 deleted the feature/get-relations-by branch April 15, 2021 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant