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

Remove optimize_children and replace with map_children #5762

Closed
alamb opened this issue Mar 28, 2023 · 0 comments · Fixed by #5984
Closed

Remove optimize_children and replace with map_children #5762

alamb opened this issue Mar 28, 2023 · 0 comments · Fixed by #5984
Labels
datafusion Changes in the datafusion crate good first issue Good for newcomers

Comments

@alamb
Copy link
Contributor

alamb commented Mar 28, 2023

The idea is that the following method can be removed and replaced with map_children introduced in #5630

pub fn optimize_children(
    optimizer: &impl PhysicalOptimizerRule,
    plan: Arc<dyn ExecutionPlan>,
    config: &ConfigOptions,
) -> Result<Arc<dyn ExecutionPlan>> {
    let children = plan
        .children()
        .iter()
        .map(|child| optimizer.optimize(Arc::clone(child), config))
        .collect::<Result<Vec<_>>>()?;

    if children.is_empty() {
        Ok(Arc::clone(&plan))
    } else {
        with_new_children_if_necessary(plan, children).map(Transformed::into)
    }
}

Originally posted by @mingmwang in #5630 (comment)

I think this would be a good first issue because it is mostly mechanical and would expose the person to datafusion's code, build and testing process

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datafusion Changes in the datafusion crate good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant