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

Chore(optimizer): fix pushdown_predicates comment example #1732

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

georgesittas
Copy link
Collaborator

@georgesittas georgesittas commented Jun 6, 2023

I updated the example so that the query we call pushdown_predicates on is equivalent to what we get by running the optimizer up to that step, not including it.

>>> import sqlglot
>>> from sqlglot.optimizer import optimize
>>> optimize("SELECT * FROM (SELECT * FROM x AS x) AS y WHERE y.a = 1", schema={"x": {"a": "int"}}).sql()
pushdown_predicates called with 'SELECT y.a AS a FROM (SELECT x.a AS a FROM x AS x) AS y WHERE y.a = 1'
'SELECT "x"."a" AS "a" FROM "x" AS "x" WHERE "x"."a" = 1'

@tobymao tobymao merged commit 1eb338a into main Jun 6, 2023
@tobymao tobymao deleted the jo/pushdown_predicates_comment_fixup branch June 6, 2023 16:38
adrianisk pushed a commit to adrianisk/sqlglot that referenced this pull request Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants