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

Inferred partition columns cause assertion error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 2.0.2
    • 2.1.0
    • Structured Streaming
    • None

    Description

      This assertion fails when you run a stream against json data that is stored in partitioned folders, if you manually specify the schema and that schema omits the partitioned columns.

      My hunch is that we are inferring those columns even though the schema is being passed in manually and adding them to the end.

      While we are fixing this bug, it would be nice to make the assertion better. Truncating is not terribly useful as, at least in my case, it truncated the most interesting part. I changed it to this while debugging:

                s"""
                   |Batch does not have expected schema
                   |Expected: ${output.mkString(",")}
                   |Actual: ${newPlan.output.mkString(",")}
                   |
                   |== Original ==
                   |$logicalPlan
                   |
                   |== Batch ==
                   |$newPlan
                 """.stripMargin
      

      I also tried specifying the partition columns in the schema and now it appears that they are filled with corrupted data.

      Attachments

        Issue Links

          Activity

            People

              brkyvz Burak Yavuz
              marmbrus Michael Armbrust
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: