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

_SUCCESS should not break partition discovery

    XMLWordPrintableJSON

    Details

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

      Description

      Partitioning discovery will fail with the following case

      test("_SUCCESS should not break partitioning discovery") {
          withTempPath { dir =>
            val tablePath = new File(dir, "table")
            val df = (1 to 3).map(i => (i, i, i, i)).toDF("a", "b", "c", "d")
      
            df.write
              .format("parquet")
              .partitionBy("b", "c", "d")
              .save(tablePath.getCanonicalPath)
      
            Files.touch(new File(s"${tablePath.getCanonicalPath}/b=1", "_SUCCESS"))
            Files.touch(new File(s"${tablePath.getCanonicalPath}/b=1/c=1", "_SUCCESS"))
            Files.touch(new File(s"${tablePath.getCanonicalPath}/b=1/c=1/d=1", "_SUCCESS"))
            checkAnswer(sqlContext.read.format("parquet").load(tablePath.getCanonicalPath), df)
          }
        }
      

      Because _SUCCESS is the in the inner partitioning dirs, partitioning discovery will fail.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                yhuai Yin Huai
                Reporter:
                yhuai Yin Huai
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: