You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by jk...@apache.org on 2017/03/13 23:30:20 UTC

spark git commit: [MINOR][ML] Improve MLWriter overwrite error message

Repository: spark
Updated Branches:
  refs/heads/master 05887fc3d -> 72c66dbbb


[MINOR][ML] Improve MLWriter overwrite error message

## What changes were proposed in this pull request?

Give proper syntax for Java and Python in addition to Scala.

## How was this patch tested?

Manually.

Author: Joseph K. Bradley <jo...@databricks.com>

Closes #17215 from jkbradley/write-err-msg.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/72c66dbb
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/72c66dbb
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/72c66dbb

Branch: refs/heads/master
Commit: 72c66dbbb4dacaf5fd77bca58c952f34eba7c147
Parents: 05887fc
Author: Joseph K. Bradley <jo...@databricks.com>
Authored: Mon Mar 13 16:30:15 2017 -0700
Committer: Joseph K. Bradley <jo...@databricks.com>
Committed: Mon Mar 13 16:30:15 2017 -0700

----------------------------------------------------------------------
 mllib/src/main/scala/org/apache/spark/ml/util/ReadWrite.scala | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/72c66dbb/mllib/src/main/scala/org/apache/spark/ml/util/ReadWrite.scala
----------------------------------------------------------------------
diff --git a/mllib/src/main/scala/org/apache/spark/ml/util/ReadWrite.scala b/mllib/src/main/scala/org/apache/spark/ml/util/ReadWrite.scala
index 09bddcd..a8b8003 100644
--- a/mllib/src/main/scala/org/apache/spark/ml/util/ReadWrite.scala
+++ b/mllib/src/main/scala/org/apache/spark/ml/util/ReadWrite.scala
@@ -104,8 +104,9 @@ abstract class MLWriter extends BaseReadWrite with Logging {
         // TODO: Revert back to the original content if save is not successful.
         fs.delete(qualifiedOutputPath, true)
       } else {
-        throw new IOException(
-          s"Path $path already exists. Please use write.overwrite().save(path) to overwrite it.")
+        throw new IOException(s"Path $path already exists. To overwrite it, " +
+          s"please use write.overwrite().save(path) for Scala and use " +
+          s"write().overwrite().save(path) for Java and Python.")
       }
     }
     saveImpl(path)


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