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

    https://github.com/apache/spark/pull/12229#discussion_r58835511
  
    --- 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. need to check for that message being null, fallback to e.toString. 
    1. Maybe also list the path in question, in case the inner one doesn't.
    1. And, perhaps, the classname of the committer in question
    
    In #12004 I'm proposing a module to add optional cloud tests, 
documentation, and make sure the relevant hadoop artifacts for s3, openstack 
and azure got pulled in to releases. It's got a [doc 
page](https://github.com/steveloughran/spark/blob/features/SPARK-7481-cloud/docs/cloud-integration.md)
 too. Assuming that gets in, the exception text could include a link to it (or 
better, the ASF link redirector). I'd add a section on commit problems there 
....


---
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