Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
SNOW-1819531: propagate referenced ctes to all root nodes #2670
base: main
Are you sure you want to change the base?
SNOW-1819531: propagate referenced ctes to all root nodes #2670
Changes from 24 commits
d2c924b
7b7ad95
ce30000
09c9752
3ca612a
8a48d9b
f7fe2eb
2fad709
850294d
8f6ca76
16909dc
4db6421
78d52aa
ffcb577
eadcd8f
28ed69b
ca9be3a
bfb1412
d826c21
2f1e1d7
5daf97e
4528959
8f0a23b
9ff53d8
fb83d0e
ee472b8
1623ca6
340769e
49072b9
dd6b2f9
4e913f8
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
What's the difference between "relaxed pipeline breaker" and "pipeline breaker"?
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.
pipeline breaker are all nodes like sort, pivot etc which are listed in the is_pipeline_breaker function.
relaxed pipeline breaker are those nodes which are not pipeline breakers but can be used to cut if no valid pipeline breaker is found. For now
SelectStatement
is the only relaxed pipeline breaker.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.
it seems we missed the cte reference propagation in the plan builder for some case, we should double check the PlanBuilder code in snowflake_plan, instead of doing the fix here
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.
After some thoughts, let's update the referenced_ctes definition to the cte referenced in the plan tree, and let's propagate the ctes reference for all nodes, in other words, let's deprecate this parameter https://github.com/snowflakedb/snowpark-python/blob/main/src/snowflake/snowpark/_internal/analyzer/snowflake_plan.py#L538, and make sure the referenced ctes is propagated correctly for all plan builder, please double check all places that directly create SnowflakePlan to make sure the referenced_ctes is propagated correctly.
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.
For the correction of code generation, we can use the way you have now, but please make sure we comment it out clearly about why things is done in such way
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.
https://snowflakecomputing.atlassian.net/browse/SNOW-1844090
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.
If the cte reference is propagated correctly during plan builder, you shouldn't need to re-propagate here.
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.
adda a comment here about why are we doing this here