Skip to content

Add projection to FilterExec to avoid unecessary output creation #5436

Closed

Description

@Dandandan

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Currently FilterExec filters/outputs all columns present in the filter expression. This does unnecessary work, as we might not need certain columns later.

Describe the solution you'd like
Add projection to Filter/FilterExec and use it before passing the RecordBatch to the arrow kernel.
This saves a bit of computation, especially when there is only one column in the projection (fast case).

Also update the schema based on the projection.

Describe alternatives you've considered

Additional context

Activity

  1. jackwener commented on Mar 1, 2023

    @jackwener
    Member

    It's a great idea.

    After it's finished, we also should do optimization job in EliminateProjection PushdownProjection

  2. Dandandan commented on Mar 1, 2023

    @Dandandan
    ContributorAuthor

    Thanks @jackwener yes, I agree (suggestion was actually inspired by your recent PR, thanks for that).

    Filter should also update the output schema based on projection, so EliminateProjection should be able to use the schema based on the change there.

  3. changed the title [-]Add projection to `FilterExec`[/-] [+]Add projection to `FilterExec` to avoid unecessary output creation[/+] on Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestperformanceMake DataFusion faster

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions