dbt-labs / dbt-labs/dbt-adapters

[Feature] Support dynamic tables copy grants for dbt-snowflake

Open
#1,154 3 comments 0 reactions 0 assignees View on GitHub
feature:dynamic-tables needs:docs pkg:dbt-snowflake type:enhancement
Dominant language
Python
Stars
233
Forks
362
Avg merge
3d 22h
Merged PRs (30d)
9

Description

### Is this your first time submitting a feature request?

- [x] I have read the [expectations for open source contributors](https://docs.getdbt.com/docs/contributing/oss-expectations)
- [x] I have searched the existing issues, and I could not find an existing issue for this feature
- [x] I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

### Describe the feature

dbt-snowflake should allow models materialized as dynamic_table to inherit existing object-level privileges by adding COPY GRANTS to the generated create [or replace] dynamic table … statement whenever config(copy_grants = true) (or the project-level +copy_grants: true) is set.

### Describe alternatives you've considered

Post-/on-run hooks that re-grant access after every dbt build. It's rather painful.

### Who will this benefit?

Anyone using snowflake dynamic tables. Having to recreate a table is a relatively common procedure.

### Are you interested in contributing this feature?

Not that familiar with DBT source code, I wouldn't feel comfortable working on this myself.

### Anything else?

There is a previous issue: https://github.com/dbt-labs/dbt-snowflake/issues/808

However it was closed. I believe that at the time, dynamic tables did not support copy grants.

But, now they do support copy grants: https://docs.snowflake.com/en/sql-reference/sql/create-dynamic-table in the usual format so I don't believe this should be hugely complicated to develop.

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.