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

[CT-385] Limit catalog generation to specific relations #300

Closed
jtcohen6 opened this issue Mar 18, 2022 · 3 comments
Closed

[CT-385] Limit catalog generation to specific relations #300

jtcohen6 opened this issue Mar 18, 2022 · 3 comments
Labels
enhancement New feature or request Stale

Comments

@jtcohen6
Copy link
Contributor

Context: #228, #296

Currently, catalog generation uses the same SQL as cache population: show table extended in <databasename> like '*'. There are good reasons to want to change this query:

  • to be faster during cache population
  • to be more targeted during catalog generation, and avoid grabbing metadata for irrelevant tables

Proposal

I think the change here will look like:

  • Decoupling the methods/macros used for cache population + catalog generation (currently both call list_relations_without_caching)
  • Including information about specific relation names (rather than just schema names) from _get_catalog_schemas
  • Passing those specific relation names into the new catalog macro, for use in the like rel_1|rel_2|rel_3|... predicate (rather than just like '*')

schema_map = self._get_catalog_schemas(manifest)

for relation in self.list_relations(database, schema):

Alternative

Revisit the change in #160. Before that change, we had to run describe extended for every single table. While generally much slower, that approach had some advantages:

@github-actions
Copy link
Contributor

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 remove the stale label or comment on the issue, or it will be closed in 7 days.

@github-actions github-actions bot added the Stale label Sep 15, 2022
@jtcohen6 jtcohen6 removed the Stale label Sep 15, 2022
@Fleid Fleid added the enhancement New feature or request label Dec 9, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

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 remove the stale label or comment on the issue, or it will be closed in 7 days.

@VShkaberda
Copy link
Contributor

VShkaberda commented Aug 1, 2023

After reading #228 I propose to reopen the issue and implement like rel_1|rel_2|rel_3|... predicate: In our case show table extended in {{ relation }} like '*' leads to failing dbt docs generate due to the fact that dbt does not have access rights to all objects in the source schema.
As I can see, this demands changes not only in _get_cache_schemas() but also in schema_relation in list_relations().
I think I'll test changes it and will propose a merge thereafter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Stale
Projects
None yet
Development

No branches or pull requests

3 participants