MaxGekk commented on code in PR #38782:
URL: https://github.com/apache/spark/pull/38782#discussion_r1032757124
##########
sql/core/src/test/scala/org/apache/spark/sql/errors/QueryExecutionErrorsSuite.scala:
##########
@@ -637,6 +637,31 @@ class QueryExecutionErrorsSuite
sqlState = "0A000")
}
+ test("FAILED_RENAME_PATH: rename when destination path already exists") {
+ withTempPath { p =>
+ withSQLConf(
+ "spark.sql.streaming.checkpointFileManagerClass" ->
classOf[FileSystemBasedCheckpointFileManager].getName,
+ "fs.file.impl" -> classOf[FakeFileSystemAlwaysExists].getName,
+ // FileSystem caching could cause a different implementation of
fs.file to be used
+ "fs.file.impl.disable.cache" -> "true") {
+ val checkpointLocation = p.getAbsolutePath
+
+ val ds = spark.readStream.format("rate").load()
+ val e = intercept[SparkConcurrentModificationException] {
+ ds.writeStream.option("checkpointLocation",
checkpointLocation).queryName("_").format("memory").start()
+ }
+
+ checkError(
+ exception = e.getCause.asInstanceOf[SparkFileAlreadyExistsException],
+ errorClass = "FAILED_RENAME_PATH",
+ sqlState = Some("22023"),
+ matchPVals = true,
+ parameters = Map("sourcePath" -> s"file:$checkpointLocation.+",
Review Comment:
You could avoid hard-coded `file:` by using `p.toURI.toString`
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]