You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Felix Maximilian Möller (JIRA)" <ji...@apache.org> on 2016/02/03 13:21:39 UTC

[jira] [Commented] (SPARK-8413) DirectParquetOutputCommitter doesn't clean up the file on task failure

    [ https://issues.apache.org/jira/browse/SPARK-8413?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15130298#comment-15130298 ] 

Felix Maximilian Möller commented on SPARK-8413:
------------------------------------------------

With 1.6.0, I ran into this problem as well. In detail I faced the situation where writing my Parquet files with DirectParquetOutputCommitter is possible. But when partitioning the data by a specific key (DataFrame.partitionBy(*col)), then one of the executors fail and leave the following error:

{noformat}
Job aborted due to stage failure: Task 1 in stage 1.0 failed 4 times, most recent failure: Lost task 1.3 in stage 1.0 (TID 52, <REDACTED>: org.apache.spark.SparkException: Task failed while writing rows.
	at org.apache.spark.sql.execution.datasources.DynamicPartitionWriterContainer.writeRows(WriterContainer.scala:414)
	at org.apache.spark.sql.execution.datasources.InsertIntoHadoopFsRelation$$anonfun$run$1$$anonfun$apply$mcV$sp$3.apply(InsertIntoHadoopFsRelation.scala:150)
	at org.apache.spark.sql.execution.datasources.InsertIntoHadoopFsRelation$$anonfun$run$1$$anonfun$apply$mcV$sp$3.apply(InsertIntoHadoopFsRelation.scala:150)
	at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:66)
	at org.apache.spark.scheduler.Task.run(Task.scala:89)
	at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:213)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.spark.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.
  File exists error: org.apache.hadoop.fs.FileAlreadyExistsException: s3a://<REDACTED>.gz.parquet already exists
	at org.apache.spark.sql.execution.datasources.BaseWriterContainer.newOutputWriter(WriterContainer.scala:137)
	at org.apache.spark.sql.execution.datasources.DynamicPartitionWriterContainer.newOutputWriter$1(WriterContainer.scala:424)
	at org.apache.spark.sql.execution.datasources.DynamicPartitionWriterContainer.writeRows(WriterContainer.scala:356)
	... 8 more

{noformat}

> DirectParquetOutputCommitter doesn't clean up the file on task failure
> ----------------------------------------------------------------------
>
>                 Key: SPARK-8413
>                 URL: https://issues.apache.org/jira/browse/SPARK-8413
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.3.1
>            Reporter: Mingyu Kim
>            Priority: Critical
>
> Here are the steps that lead to the failure.
> 1. Write a DataFrame using DirectParquetOutputCommitter
> 2. 1st attempt fails during the writes. e.g. https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/parquet/ParquetTableOperations.scala#L355
> 3. There is no clean-up logic on task failure, so the parquet part file written by the failed task is left half-written.
> 4. 2nd attempt fails with the following exception because the target file already exists.
> {noformat}
> 2015-06-15T15:37:32.703 WARN [task-result-getter-2] org.apache.spark.scheduler.TaskSetManager - Lost task 56.1 in stage 7.0 (TID 73125, <REDACTED>): java.io.IOException: File already exists:s3://<REDACTED>
>         at <REDACTED>
> 	at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:851)
> 	at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:832)
> 	at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:731)
> 	at parquet.hadoop.ParquetFileWriter.<init>(ParquetFileWriter.java:154)
> 	at parquet.hadoop.ParquetOutputFormat.getRecordWriter(ParquetOutputFormat.java:279)
> 	at parquet.hadoop.ParquetOutputFormat.getRecordWriter(ParquetOutputFormat.java:252)
> 	at org.apache.spark.sql.parquet.InsertIntoParquetTable.org$apache$spark$sql$parquet$InsertIntoParquetTable$$writeShard$1(ParquetTableOperations.scala:350)
> 	at org.apache.spark.sql.parquet.InsertIntoParquetTable$$anonfun$saveAsHadoopFile$1.apply(ParquetTableOperations.scala:371)
> 	at org.apache.spark.sql.parquet.InsertIntoParquetTable$$anonfun$saveAsHadoopFile$1.apply(ParquetTableOperations.scala:371)
> 	at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:61)
> 	at org.apache.spark.scheduler.Task.run(Task.scala:64)
> 	at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:203)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> 	at java.lang.Thread.run(Thread.java:745)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org