Github user liancheng commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6612#discussion_r31698594
  
    --- Diff: 
sql/hive/src/test/scala/org/apache/spark/sql/sources/hadoopFsRelationSuites.scala
 ---
    @@ -594,4 +594,29 @@ class ParquetHadoopFsRelationSuite extends 
HadoopFsRelationTest {
           checkAnswer(read.format("parquet").load(path), df)
         }
       }
    +
    +  test("SPARK-8079: Avoid NPE thrown from BaseWriterContainer.abortJob") {
    +    withTempPath { dir =>
    +      val path = dir.getCanonicalPath
    +
    +      val cause = intercept[Throwable] {
    +        // Parquet doesn't allow field names with spaces.  Here we are 
intentionally making an
    +        // exception thrown from the 
`ParquetRelation2.prepareForWriteJob()` method to trigger
    +        // the bug.  Please refer to spark-8079 for more details.
    +        range(1, 10)
    +          .withColumnRenamed("id", "a b")
    +          .write
    +          .format("parquet")
    +          .save(path)
    +      }
    +
    +      cause match {
    --- End diff --
    
    Good point.
    
    (By the time this PR was authored, the Parquet field name check hadn't been 
modified to throw `AnalysisException` yet.)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to