Skip to content

Redundant repartition after explicit repartition #2250

Description

@linhr

When I was reviewing #2183 I noticed something that worth looking into (unrelated to the changes in the PR).

>>> spark.range(6).repartition(3).filter(F.col("id") % 2 == 0).explain()
== Physical Plan ==
ProjectionExec: expr=[#0@0 as id]
  FilterExec: #0@0 % 2 = 0
    RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=3
      ExplicitRepartitionExec: partitioning=RoundRobinBatch(3), input_partitions=1
        RangeExec

I feel the RepartitionExec node should be removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions