From 538bc864f8ebb8d1b7e63c26806f209f2c3b0fc4 Mon Sep 17 00:00:00 2001 From: Ryan Blue Date: Mon, 12 Feb 2018 10:32:13 -0800 Subject: [PATCH] Fix docs and style nit. --- .../spark/sql/sources/v2/writer/DataSourceWriter.java | 6 +++--- .../sql/execution/datasources/v2/WriteToDataSourceV2.scala | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/sql/core/src/main/java/org/apache/spark/sql/sources/v2/writer/DataSourceWriter.java b/sql/core/src/main/java/org/apache/spark/sql/sources/v2/writer/DataSourceWriter.java index 797750cb12c55..0073ebb631e6b 100644 --- a/sql/core/src/main/java/org/apache/spark/sql/sources/v2/writer/DataSourceWriter.java +++ b/sql/core/src/main/java/org/apache/spark/sql/sources/v2/writer/DataSourceWriter.java @@ -89,10 +89,10 @@ default void onDataWriterCommit(WriterCommitMessage message) {} * is undefined and @{@link #abort(WriterCommitMessage[])} may not be able to deal with it. * * Note that speculative execution may cause multiple tasks to run for a partition. By default, - * Spark uses the commit coordinator to allow only one attempt to commit. Implementations can + * Spark uses the commit coordinator to allow at most one attempt to commit. Implementations can * disable this behavior by overriding {@link #useCommitCoordinator()}. If disabled, multiple - * attempts may have committed successfully and all successful commit messages are passed to this - * commit method. + * attempts may have committed successfully and one successful commit message per task will be + * passed to this commit method. The remaining commit messages are ignored by Spark. */ void commit(WriterCommitMessage[] messages); diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/WriteToDataSourceV2.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/WriteToDataSourceV2.scala index f85609fd8df67..535e7962d7439 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/WriteToDataSourceV2.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/WriteToDataSourceV2.scala @@ -135,7 +135,6 @@ object DataWritingSparkTask extends Logging { if (commitAuthorized) { logInfo(s"Writer for stage $stageId, task $partId.$attemptId is authorized to commit.") dataWriter.commit() - } else { val message = s"Stage $stageId, task $partId.$attemptId: driver did not authorize commit" logInfo(message)