Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-31412 New Adaptive Query Execution in Spark SQL
  3. SPARK-31384

NPE in OptimizeSkewedJoin when there's a inputRDD of plan has 0 partition

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 3.0.0
    • SQL
    • None

    Description

      When there's a inputRDD of a plan with 0 partitions, rule OptimizeSkewedJoin can hit NPE.

      The issue can be reproduced by below test:

      withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true",
        SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1") {
        withTempView("t2") {
          // create DataFrame with 0 partition
          spark.createDataFrame(sparkContext.emptyRDD[Row], new StructType().add("b", IntegerType))
            .createOrReplaceTempView("t2")
          // should run successfully without NPE
          runAdaptiveAndVerifyResult("SELECT * FROM testData2 t1 left semi join t2 ON t1.a=t2.b")
        }
      }
      

      Attachments

        Issue Links

          Activity

            People

              Ngone51 wuyi
              Ngone51 wuyi
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: