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

Reduce repetition in try_process_group_by_unnest and try_process_unnest #11714

Merged
merged 2 commits into from
Jul 31, 2024

Conversation

JasonLi-cn
Copy link
Contributor

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?

@github-actions github-actions bot added the sql SQL Planner label Jul 30, 2024
Copy link
Contributor

@alamb alamb left a 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
Copy link
Contributor

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

Copy link
Contributor Author

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. 🙏

Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor

@jayzhan211 jayzhan211 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@jonahgao jonahgao left a 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!

@alamb alamb merged commit 8ac50e2 into apache:main Jul 31, 2024
24 checks passed
@alamb
Copy link
Contributor

alamb commented Jul 31, 2024

Thanks everyone and thank you @duongcongtoai for the follow up

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

Successfully merging this pull request may close these issues.

Reduce repetition in try_process_group_by_unnest and try_process_unnest
5 participants