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

Remove query to information_schema.schemata in BigQuery catalog generation #2320

Closed
drewbanin opened this issue Apr 14, 2020 · 0 comments · Fixed by #2382
Closed

Remove query to information_schema.schemata in BigQuery catalog generation #2320

drewbanin opened this issue Apr 14, 2020 · 0 comments · Fixed by #2382
Labels
bigquery enhancement New feature or request

Comments

@drewbanin
Copy link
Contributor

Describe the feature

See here: https://stackoverflow.com/questions/59891634/how-can-i-give-others-permission-to-read-my-information-schema-schemata-in-bigqu

Sounds like some dbt users are having issues running the catalog query generated by dbt because they lack permissions to see all of the datasets in a given project, and BigQuery lacks the kinds of granular permissioning constructs we'd expect to see from a database.

dbt currently uses the information_schema.schemata table solely to find the location for datasets referenced in a dbt project.

As a workaround, we can do one of the following:

  • Remove the subquery that hits information_schema.schemata and stop producing a location in the catalog
  • Remove the subquery that hits information_schema.schemata and instead grab the location from the BQ API after the information schema queries have completed
  • Run the query that hits the schemata table as a separate statement, joining the results in memory (like we do on Redshift):

https://github.com/fishtown-analytics/dbt/blob/d2760d5a494b81f6d477a67738ecdc37facdd5ec/plugins/redshift/dbt/include/redshift/macros/catalog.sql#L231-L241

Describe alternatives you've considered

Additional context

BigQuery

Who will this benefit?

BigQuery users with nontrivial permissioning needs

@drewbanin drewbanin added enhancement New feature or request bigquery labels Apr 14, 2020
@drewbanin drewbanin added this to the Octavius Catto milestone Apr 14, 2020
beckjake added a commit that referenced this issue May 1, 2020
remove location and information_schema.schematas query from catalog (#2320)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bigquery enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant