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

    https://github.com/apache/spark/pull/12229#discussion_r58978934
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/WriterContainer.scala
 ---
    @@ -129,16 +129,17 @@ private[sql] abstract class BaseWriterContainer(
           outputWriterFactory.newInstance(path, bucketId, dataSchema, 
taskAttemptContext)
         } catch {
           case e: org.apache.hadoop.fs.FileAlreadyExistsException =>
    -        if 
(outputCommitter.isInstanceOf[parquet.DirectParquetOutputCommitter]) {
    -          // Spark-11382: DirectParquetOutputCommitter is not idempotent, 
meaning on retry
    +        if (outputCommitter.getClass.getName.contains("Direct")) {
    +          // SPARK-11382: DirectParquetOutputCommitter is not idempotent, 
meaning on retry
               // attempts, the task will fail because the output file is 
created from a prior attempt.
               // This often means the most visible error to the user is 
misleading. Augment the error
               // to tell the user to look for the actual error.
               throw new SparkException("The output file already exists but 
this could be due to a " +
                 "failure from an earlier attempt. Look through the earlier 
logs or stage page for " +
    -            "the first error.\n  File exists error: " + e)
    +            "the first error.\n  File exists error: " + 
e.getLocalizedMessage, e)
    --- End diff --
    
    1. oops - it should be getMessage. I'm not sure how it ended up being 
getLocalizedMessage. I will fix it.
    2. the inner already has the error typically.
    3. this is mostly a hack in case people are using their own direct ouput 
committer, and isn't really meant to be bulletproof.



---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to