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

EXPLAIN ANALYZE should run all Optimizer passes #929

Merged
merged 1 commit into from
Aug 23, 2021

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Aug 23, 2021

Which issue does this PR close?

Fixes #917 found by @Dandandan

Rationale for this change

  1. EXPLAIN ANALYZE should run the same plan as normal execution

What changes are included in this PR?

  1. Fix bug
  2. Add test
  3. Add assert_contains! macro in sql.rs (from IOx) to make the testing less repetitious

Are there any user-facing changes?

Bug is fixed

@github-actions github-actions bot added the datafusion Changes in the datafusion crate label Aug 23, 2021
LogicalPlan::Analyze {
verbose, schema, ..
} => {
assert!(expr.is_empty());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here is the actual bug fix: the code that builds up LogicalPlans from optimized inputs ignored the inputs for Analyze. I have a follow on PR to try and make this kind of thing harder to introduce in the future: #930

@alamb alamb merged commit 1922130 into apache:master Aug 23, 2021
@alamb alamb deleted the alamb/fix_analyze branch August 25, 2021 10:54
@houqp houqp added the bug Something isn't working label Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working datafusion Changes in the datafusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Explain analyze doesn't (fully) optimize queries
3 participants