Skip to content

Conversation

@andygrove
Copy link
Member

@andygrove andygrove commented Jun 1, 2022

Which issue does this PR close?

Closes #2599

Rationale for this change

As a user of DataFusion for SQL query planning, I would like to be able to use the logical plan optimizer rules without depending on the full datafusion crate containing the execution engine.

What changes are included in this PR?

Are there any user-facing changes?

I added public re-exports for now to maintain API compatibility but there is a new crate so technically this is probably still an API change.

Does this PR break compatibility with Ballista?

No

@andygrove andygrove added the api change Changes the API exposed to users of the crate label Jun 1, 2022
@andygrove andygrove self-assigned this Jun 1, 2022
@github-actions github-actions bot added core Core DataFusion crate datafusion optimizer Optimizer rules labels Jun 1, 2022
@andygrove andygrove changed the title WIP: Create new datafusion-optimizer crate for logical optimizer rules Create new datafusion-optimizer crate for logical optimizer rules Jun 1, 2022
@andygrove andygrove marked this pull request as ready for review June 1, 2022 23:16
@andygrove
Copy link
Member Author

@alamb @tustvold @yjshen PTAL when you have time. This is the last piece of the crate refactoring that I had planned. There is just one optimizer rule that needs to be moved over to the new crate and I hope to get that moved in the next 1-2 weeks.

Copy link
Contributor

@tustvold tustvold left a comment

Choose a reason for hiding this comment

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

This seems sensible to me, I think some code should be being moved instead of copied though

@@ -0,0 +1,80 @@
// Licensed to the Apache Software Foundation (ASF) under one
Copy link
Contributor

Choose a reason for hiding this comment

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

This appears to be duplicating the file from core, instead of moving it. Is this intentional?

Copy link
Member Author

Choose a reason for hiding this comment

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

@tustvold Thanks. I hadn't realized that this was only used by the optimizer test. I have now moved this instead,

pub mod user_defined;

/// some tests share a common table with different names
pub fn test_table_scan_with_name(name: &str) -> Result<LogicalPlan> {
Copy link
Contributor

Choose a reason for hiding this comment

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

These functions don't appear to be being used by any tests that haven't also been moved, so perhaps they could be removed from core also?

Copy link
Member Author

Choose a reason for hiding this comment

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

I have removed this from core now

@andygrove andygrove merged commit 0651a5e into apache:master Jun 2, 2022
@andygrove andygrove deleted the optimizer-crate branch June 2, 2022 19:15
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 @andygrove and @tustvold

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 optimizer Optimizer rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move logical optimizer rules out of the core datafusion crate

3 participants