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

Make list_relations_without_caching pagination configurable #1235

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mikealfare
Copy link
Contributor

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_iteration: 10000
  list_relations_iteration_limit: 100

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX

@mikealfare mikealfare requested a review from a team as a code owner November 7, 2024 22:02
@cla-bot cla-bot bot added the cla:yes label Nov 7, 2024
Copy link
Contributor

github-actions bot commented Nov 7, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] dbt-snowflake raises an error when caching less than the maximum number of objects in a schema
1 participant