Skip to content

Minor: provide default implementation for ExecutionPlan::statistics #7911

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Oct 24, 2023

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Oct 23, 2023

Which issue does this PR close?

Follow on to #7793

Rationale for this change

While integrating #7793 into IOx, I found I had to change many of our ExecutionPlan implementations with the boilerplate (but non trivial) ExecutionPlan::statistics implementation

        fn statistics(&self) -> Result<datafusion::physical_plan::Statistics, DataFusionError> {
            Ok(datafusion::physical_plan::Statistics::new_unknown(&self.schema()))
        }

In order the ease the upgrade pain for others, we should provide this as a default.

What changes are included in this PR?

  1. Provide a default impl for ExecutionPlan::statistics
  2. Improve documentation

Are these changes tested?

Covered by existing tests

Are there any user-facing changes?

Hopefully a slightly less painful upgrade for #7793

@github-actions github-actions bot added the core Core DataFusion crate label Oct 23, 2023
@@ -238,10 +238,6 @@ impl ExecutionPlan for UnboundedExec {
batch: self.batch.clone(),
}))
}

fn statistics(&self) -> Result<Statistics> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The whole point of this PR is to provide this as a default implementation

@crepererum crepererum merged commit ba50a8b into apache:main Oct 24, 2023
@alamb alamb deleted the alamb/default_statistics branch October 24, 2023 12:59
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
core Core DataFusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants