Skip to content

Avoid masking errors and producing suboptimal plans #11285

@findepi

Description

@findepi

Is your feature request related to a problem or challenge?

Optimizer returns early when a rewrite produces a certain plan for the second time.
Producing same plan again is considered a problem. Returning early is to prevent (avoidable) failure for the user, however

  • it can masks actual problems (we don't know when optimization finishes early)
  • it can lead to suboptimal plan being executed, which may be very expensive -- for example containing cross join because predicates weren't pushed into the join yet

Describe the solution you'd like

Do not mask problems. Let the code fail fast, so that bugs are clear.
As interim solution, we can have a flag allowing user to recover by restoring current lenient behavior.

This can be modelled after existing datafusion.optimizer.skip_failed_rules config which serves similar purpose.

Describe alternatives you've considered

No response

Additional context

originates from #5623 (comment)
cc @mslapek @alamb

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