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

IllegalArgumentException when applying RemoveRedundantSorts before EnsureRequirements

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.4.8, 3.0.2, 3.1.0
    • 2.4.8, 3.0.2, 3.1.0
    • SQL
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: