-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
fix #7390: push down limit filtering to adapter #7545
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
love a great simpl impl (simple implementation). my first though is one @jtcohen6 already brought up in the source issue
In order to write the subquery in a cross-database-compatible way, we should either
- Use a (Jinja) macro or materialization to template the subquery with limit
- Use an adapter (Python) method — much easier to implement, and probably sufficient
with any mention of LIMIT
my "incompatible with TSQL" sense tingles and prompts me to think
how will this work with SELECT TOP N?
Is this supported bypyodbc
and MSFT'smsodbc18
?
However, the use of limit
here is semantic. In reality, the change here is to make use of a DB API 2.0 Cursor method, fetchmany()
(PEP 249: fetchmany()).
Now my brain is thinking about how our ConnectionManager class methods map to PEP249. As a less-in-the-weeds person, I have a hard time understanding when dbt makes use of all the execute* and fetch* variants of the DB API 2.0.
Also, is there a clear implementation recommendation for non-dbapi2 adapters (e.g. BQ, DB, and (increasingly RS)
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.5.latest 1.5.latest
# Navigate to the new working tree
cd .worktrees/backport-1.5.latest
# Create a new branch
git switch --create backport-7545-to-1.5.latest
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 078a83679a2d77ea6da9a8fac113498791361fe8
# Push it to GitHub
git push --set-upstream origin backport-7545-to-1.5.latest
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.5.latest Then, create a pull request where the |
@aranke This is causing failures in
Update: I just saw the PRs for this in dbt-labs/dbt-redshift#435, dbt-labs/dbt-bigquery#707, etc. |
resolves #7390
Description
Checklist
changie new
to create a changelog entry