Skip to content

Simplify decision logic to call FilterBuilder::optimize or not #8781

@pepijnve

Description

@pepijnve

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

Optimizing filters is beneficial when the filter will be used to process more than one array. For single arrays it can still be useful depending on the DataType of the array. The logic to make this determination is currently private. This requires users of FilterBuilder to duplicate the logic.

Describe the solution you'd like

Provide a public function that can help in deciding if calling optimise is useful or not.

Describe alternatives you've considered

Do nothing; duplicate the code.
This is suboptimal because the decision logic is tightly coupled with the actual filter implementation logic. If the filtering logic is changed, the 'is beneficial' logic should be adapted as well.

Additional context

Useful for DataFusion case implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementAny new improvement worthy of a entry in the changelog

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions