dongjoon-hyun commented on a change in pull request #24233: [SPARK-26356][SQL]
remove SaveMode from data source v2
URL: https://github.com/apache/spark/pull/24233#discussion_r287456877
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/test/DataFrameReaderWriterSuite.scala
##########
@@ -239,15 +243,75 @@ class DataFrameReaderWriterSuite extends QueryTest with
SharedSQLContext with Be
}
test("save mode") {
- val df = spark.read
+ spark.range(10).write
.format("org.apache.spark.sql.test")
- .load()
+ .mode(SaveMode.ErrorIfExists)
+ .save()
+ assert(LastOptions.saveMode === SaveMode.ErrorIfExists)
- df.write
+ spark.range(10).write
+ .format("org.apache.spark.sql.test")
+ .mode(SaveMode.Append)
+ .save()
+ assert(LastOptions.saveMode === SaveMode.Append)
+
+ // By default the save mode is `ErrorIfExists` for data source v1.
+ spark.range(10).write
.format("org.apache.spark.sql.test")
- .mode(SaveMode.ErrorIfExists)
.save()
assert(LastOptions.saveMode === SaveMode.ErrorIfExists)
+
+ spark.range(10).write
+ .format("org.apache.spark.sql.test")
+ .mode("default")
+ .save()
+ assert(LastOptions.saveMode === SaveMode.ErrorIfExists)
Review comment:
Thanks!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]