dbt-labs / dbt-snowflake

dbt-snowflake contains all of the code enabling dbt to work with Snowflake
https://getdbt.com
Apache License 2.0
296 stars 176 forks source link

Make `list_relations_without_caching` pagination configurable #1235

Closed mikealfare closed 3 days ago

mikealfare commented 2 weeks ago

resolves #1234

Problem

Some users have over 100K objects in a single schema. We need to paginate results from show objects since that call is limited to 10K objects by Snowflake. We hard coded this result to 10 pages. However this doesn't allow users to have more than 100K objects in their schema. In this scenario, users are hit with an error that blocks dbt from running anything.

Solution

Allow users to configure the pagination using project flags. They can configure both the number of results per page as well as the number of pages. This defaults to the current setting of 10000 results per page and 10 pages if the flags are not passed in. Example:

# dbt-project.yml
flags:
  list_relations_per_page: 10000
  list_relations_page_limit: 100

Checklist

github-actions[bot] commented 2 weeks ago

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the dbt-snowflake contributing guide.

mikealfare commented 3 days ago

I think this got accidentally closed with the docs PR.