Skip to content

Conversation

@alamb
Copy link
Contributor

@alamb alamb commented Apr 27, 2023

Extract LogicalPlan::Drop* DDL related plan structures into LogicalPlan::Ddl

Which issue does this PR close?

Closes #1281

Rationale for this change

While reviewing #6096 from @jaylmiller I noticed that the LogicalPlan was getting quite large for the various Catalog manipulation statements

What changes are included in this PR?

Move LogicalPlan::Drop* variants into LogicalPlan::Ddl to keep them more isolated

Are these changes tested?

Covered by existing tests

Are there any user-facing changes?

Yes, this is an API change -- some LogicalPlan variants are now wrapped up another layer of struct

@github-actions github-actions bot added core Core DataFusion crate logical-expr Logical plan and expressions optimizer Optimizer rules sql SQL Planner labels Apr 27, 2023
@alamb alamb changed the title Alamb/complete ddl Complete Extracting LogicalPlan::Drop* DDL related plan structures into LogicalPlan::Ddl Apr 27, 2023
@alamb alamb force-pushed the alamb/complete_ddl branch from fa48254 to 8325565 Compare April 27, 2023 20:46
@alamb alamb added the api change Changes the API exposed to users of the crate label Apr 27, 2023
LogicalPlan::DropTable(DropTable {
name, if_exists, ..
}) => {
let result = self.find_and_deregister(&name, TableType::Base).await;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved these into their own functions for consistency

@alamb alamb marked this pull request as ready for review April 27, 2023 20:50
Copy link
Contributor

@yukkit yukkit left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@metesynnada metesynnada left a comment

Choose a reason for hiding this comment

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

LGTM, this will significantly streamline the logical plans. Thanks!

@alamb alamb merged commit 2b33182 into apache:main Apr 28, 2023
@alamb alamb deleted the alamb/complete_ddl branch April 28, 2023 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api change Changes the API exposed to users of the crate core Core DataFusion crate logical-expr Logical plan and expressions optimizer Optimizer rules sql SQL Planner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Break up DDL and Query LogicalPlan variants

3 participants