diff options
author | Joseph K. Bradley <joseph@databricks.com> | 2017-03-13 16:30:15 -0700 |
---|---|---|
committer | Joseph K. Bradley <joseph@databricks.com> | 2017-03-13 16:30:15 -0700 |
commit | 72c66dbbb4dacaf5fd77bca58c952f34eba7c147 (patch) | |
tree | e7491bcd0871acb466af55368cf32eff51fb6532 /mllib/src | |
parent | 05887fc3d8d517b416992ee870d0f865b1f9a3d0 (diff) | |
download | spark-72c66dbbb4dacaf5fd77bca58c952f34eba7c147.tar.gz spark-72c66dbbb4dacaf5fd77bca58c952f34eba7c147.tar.bz2 spark-72c66dbbb4dacaf5fd77bca58c952f34eba7c147.zip |
[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 <joseph@databricks.com>
Closes #17215 from jkbradley/write-err-msg.
Diffstat (limited to 'mllib/src')
-rw-r--r-- | mllib/src/main/scala/org/apache/spark/ml/util/ReadWrite.scala | 5 |
1 files changed, 3 insertions, 2 deletions
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 09bddcdb81..a8b80031fa 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) |