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

Use explicit enum for physical errors #2

Merged
merged 2 commits into from
Nov 3, 2024

Conversation

alamb
Copy link

@alamb alamb commented Nov 3, 2024

Note this targets apache#13210

While reviewing apache#13210 from @Lordworms I had an alternate suggestion on how to get the errors to appear in the explain plan. This PR implements that suggestion

@@ -62,6 +62,8 @@ pub enum PlanType {
FinalPhysicalPlanWithStats,
/// The final with schema, fully optimized physical plan which would be executed
FinalPhysicalPlanWithSchema,
/// An error creating the physical plan
PhysicalPlanError,
Copy link
Author

Choose a reason for hiding this comment

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

By adding an explicit new "plan type" it became clear how to show the errors

Copy link
Owner

Choose a reason for hiding this comment

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

Yes, that's what I want to do in the begining, but I didn't want to introduce many overhead so I changed it. Sometimes I am confused about balancing change size and simplicity. Thanks for your suggestion!

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, it is totally a judgement call

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, it is totally a judgement call -- I don't think there is ever one right answer

vec![StringifiedPlan::new(FinalLogicalPlan, err.to_string())],
e.verbose,
))))
stringified_plans.push(StringifiedPlan::new(
Copy link
Author

Choose a reason for hiding this comment

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

this is the core difference -- rather than using a special ExplainExec instead use a new "plan type" that isn't filtered out of the normal explain

04)------Cross Join:
05)--------TableScan: t1
06)--------TableScan: t2
physical_plan_error This feature is not implemented: Unsupported logical plan: Dml(Update)
Copy link
Author

Choose a reason for hiding this comment

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

this way we still see the logical explain, but now it is also clear there is a physical plan error

@Lordworms Lordworms merged commit 82d9560 into Lordworms:issue_5265 Nov 3, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants