-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Reduce repetition in try_process_group_by_unnest and try_process_unnest #11714
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.
Thank you @JasonLi-cn -- this looks like an improvement to me ❤️
cc @jonahgao
inner_projection_exprs: &mut Vec<Expr>, | ||
original_exprs: &[Expr], | ||
) -> Result<Vec<Expr>> { | ||
Ok(original_exprs |
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.
This does the recursion manually -- I wonder if it would be possible / useful to do the recursion using transform_up
from TreeNode: https://docs.rs/datafusion/latest/datafusion/common/tree_node/trait.TreeNode.html#method.transform_up
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.
Thank you @alamb for your review. I'm not quite sure what you mean, maybe you can add more description, thanks again. 🙏
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.
I think I was confused -- sorry
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.
I think we can, in fact transform_up_down is needed, i'll introduce why in this PR when it's ready: #11577
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.
👍
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.
Looks good to me!
Thanks everyone and thank you @duongcongtoai for the follow up |
Which issue does this PR close?
Closes #11498 (comment)
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?