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

minor: do not fail analyzer if subquery plan contains extension #7455

Merged
merged 2 commits into from
Sep 6, 2023

Conversation

waynexia
Copy link
Member

Which issue does this PR close?

Closes #.

Rationale for this change

If some analyze rule inserts extension plan, the post-analyze check will fail.

What changes are included in this PR?

It looks acceptable for an analyzer rule to do so and can simply "ignore" extension plan node, e.g., the outermost node can either be [Projection, Filter, Window, Aggregate, Join], or an extension node

Are these changes tested?

n/a

Are there any user-facing changes?

n/a

@github-actions github-actions bot added the optimizer Optimizer rules label Aug 31, 2023
Signed-off-by: Ruihang Xia <[email protected]>
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.

LGTM -- thanks @waynexia

@@ -338,3 +339,57 @@ fn check_mixed_out_refer_in_window(window: &Window) -> Result<()> {
Ok(())
}
}

#[cfg(test)]
Copy link
Contributor

Choose a reason for hiding this comment

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

I recommend putting this test somewhere in https://github.com/apache/arrow-datafusion/tree/main/datafusion/core/tests/user_defined (mostly so it is easier to find and to ensure everything is working as expected)

I think you may be able to reuse the dummy user defined code there

Copy link
Member Author

Choose a reason for hiding this comment

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

Great suggestion. I plan to cover this case in datafusion/core/tests/user_defined/user_defined_plan.rs. But since the previous TopK is based on optimizer, I may need to add another extension plan and an analyzer rule.

@alamb alamb merged commit 4e33be5 into apache:main Sep 6, 2023
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimizer Optimizer rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants