Skip to content

Make OptimizerRule Consuming #4627

@tustvold

Description

@tustvold

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

The current interface for OptimizerRule takes &LogicalPlan, effectively forcing rules to clone their input.

Describe the solution you'd like

#4208 added a try_optimise method to try to reduce this, but I think it would make for a cleaner interface if the method was simply.

fn apply(
    &self,
    plan: LogicalPlan,
    optimizer_config: &mut OptimizerConfig,
) -> Result<LogicalPlan> {
    Ok(self.try_optimize(&plan, optimizer_config)?.unwrap_or(plan))
}

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context

#4208

FYI @andygrove @alamb @jackwener

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions