Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-33472

IllegalArgumentException when applying RemoveRedundantSorts before EnsureRequirements

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.8, 3.0.2, 3.1.0
    • Fix Version/s: 2.4.8, 3.0.2, 3.1.0
    • Component/s: SQL
    • Labels:
      None

      Description

      `RemoveRedundantSorts` rule uses SparkPlan's `outputPartitioning` to check whether a sort node is redundant. Currently, it is added before `EnsureRequirements`. Since `PartitioningCollection` requires left and right partitioning to have the same number of partitions, which is not necessarily true before applying `EnsureRequirements`, the rule can fail with the following exception:

      IllegalArgumentException: requirement failed: PartitioningCollection requires all of its partitionings have the same numPartitions.

      We should switch the order between these two rules to satisfy the requirement when instantiating `PartitioningCollection`.

       

        Attachments

          Activity

            People

            • Assignee:
              allisonwang-db Allison Wang
              Reporter:
              allisonwang-db Allison Wang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: