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

Move PruningPredicate to physical-optimizer crate #12037

Closed
wants to merge 2 commits into from

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Aug 16, 2024

Which issue does this PR close?

Part of #11502

Rationale for this change

We are trying to break up pieces the datafusion crate into smaller pieces for faster compile time and better modularity. Part of this is the physical optimizer

What changes are included in this PR?

Move PruningPredicate into the physical optimizer crate

Are these changes tested?

Yes, by existing CI

Are there any user-facing changes?

No, there are backwards compatible pub use that mean no user change are required

@github-actions github-actions bot added optimizer Optimizer rules core Core DataFusion crate labels Aug 16, 2024
//! Physical expressions. They are kept in their own crate to avoid physical
//! expressions depending on logical expressions.
//!
//! Note this crate is not intended to have substantial logic itself, but rather
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 added some additional explanation about this crate (partly as a justification about why it was ok to depend on in the physical optimizer)

@@ -23,3 +23,5 @@ mod optimizer;
pub mod output_requirements;

pub use optimizer::PhysicalOptimizerRule;

pub mod pruning;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was just to make the use statements less ugly

@@ -615,7 +611,8 @@ impl PruningPredicate {
is_always_true(&self.predicate_expr) && self.literal_guarantees.is_empty()
}

pub(crate) fn required_columns(&self) -> &RequiredColumns {
/// Return the columns that are required to evaluate the pruning predicate
pub fn required_columns(&self) -> &RequiredColumns {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

as it is in a different crate now this function needs to become pub, which I think is reasonable as it is part of the API

Likewise the change to make RequiredColumns pub

@@ -29,7 +29,6 @@ pub mod join_selection;
pub mod limited_distinct_aggregation;
pub mod optimizer;
pub mod projection_pushdown;
pub mod pruning;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is a

pub use datafusion_physical_optimizer::*;

a few lines down which adds an alias to the pruning module in its new home

@alamb alamb force-pushed the alamb/move_pruning_predicate branch from 519f0f3 to 5a5fa91 Compare August 16, 2024 14:46
@alamb alamb marked this pull request as draft August 16, 2024 14:48
@alamb
Copy link
Contributor Author

alamb commented Aug 16, 2024

I need to update the tests

@alamb alamb closed this Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate optimizer Optimizer rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant