Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-37063 SQL Adaptive Query Execution QA: Phase 2
  3. SPARK-38013

AQE can change bhj to smj if no extra shuffle introduce

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.3.0
    • 3.3.0, 3.2.2
    • SQL, Tests
    • None

    Description

      An example to reproduce the bug.

      create table t1 as select 1 c1, 2 c2;
      create table t2 as select 1 c1, 2 c2;
      create table t3 as select 1 c1, 2 c2;
      
      set spark.sql.adaptive.autoBroadcastJoinThreshold=-1;
      
      select /*+ merge(t3) */ * from t1
      left join (
      select c1 as c from t3
      ) t3 on t1.c1 = t3.c
      left join (
      select /*+ repartition(c1) */ c1 from t2
      ) t2 on t1.c1 = t2.c1;
      
      

      The key to produce this bug is that a bhj convert to smj/shj without introducing extra shuffe and AQE does not think the join can be planned as bhj.

      Attachments

        Activity

          People

            ulysses XiDuo You
            ulysses XiDuo You
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: