You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/08/22 09:43:09 UTC

[GitHub] [spark] lvshaokang opened a new pull request, #37611: [SPARK-38749][SQL][TESTS] Test the error class: RENAME_SRC_PATH_NOT_FOUND

lvshaokang opened a new pull request, #37611:
URL: https://github.com/apache/spark/pull/37611

   ### What changes were proposed in this pull request?
   
   I add a test case for the error class `RENAME_SRC_PATH_NOT_FOUND` in the QueryCompilationErrorsSuite.
   
   ### Why are the changes needed?
   
   To improve test coverage, and record expected error messages in tests.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   ./build/sbt "test:testOnly *QueryCompilationErrorsSuite"


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] lvshaokang commented on pull request #37611: [SPARK-38749][SQL][TESTS] Test the error class: RENAME_SRC_PATH_NOT_FOUND

Posted by GitBox <gi...@apache.org>.
lvshaokang commented on PR #37611:
URL: https://github.com/apache/spark/pull/37611#issuecomment-1223715084

   @MaxGekk PTAL. 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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] lvshaokang commented on a diff in pull request #37611: [SPARK-38749][SQL][TESTS] Test the error class: RENAME_SRC_PATH_NOT_FOUND

Posted by GitBox <gi...@apache.org>.
lvshaokang commented on code in PR #37611:
URL: https://github.com/apache/spark/pull/37611#discussion_r952451518


##########
sql/core/src/test/scala/org/apache/spark/sql/errors/QueryCompilationErrorsSuite.scala:
##########
@@ -616,6 +622,31 @@ class QueryCompilationErrorsSuite
         "functionName" -> "`array_contains`",
         "classCanonicalName" -> "org.apache.spark.sql.catalyst.expressions.ArrayContains"))
   }
+
+  test("RENAME_SRC_PATH_NOT_FOUND: rename the file which source path does not exist") {

Review Comment:
   @MaxGekk done.



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] MaxGekk closed pull request #37611: [SPARK-38749][SQL][TESTS] Test the error class: RENAME_SRC_PATH_NOT_FOUND

Posted by GitBox <gi...@apache.org>.
MaxGekk closed pull request #37611: [SPARK-38749][SQL][TESTS] Test the error class: RENAME_SRC_PATH_NOT_FOUND
URL: https://github.com/apache/spark/pull/37611


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] MaxGekk commented on pull request #37611: [SPARK-38749][SQL][TESTS] Test the error class: RENAME_SRC_PATH_NOT_FOUND

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on PR #37611:
URL: https://github.com/apache/spark/pull/37611#issuecomment-1228202497

   +1, LGTM. Merging to master.
   Thank you, @lvshaokang.


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] MaxGekk commented on a diff in pull request #37611: [SPARK-38749][SQL][TESTS] Test the error class: RENAME_SRC_PATH_NOT_FOUND

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on code in PR #37611:
URL: https://github.com/apache/spark/pull/37611#discussion_r952373110


##########
sql/core/src/test/scala/org/apache/spark/sql/errors/QueryCompilationErrorsSuite.scala:
##########
@@ -616,6 +622,31 @@ class QueryCompilationErrorsSuite
         "functionName" -> "`array_contains`",
         "classCanonicalName" -> "org.apache.spark.sql.catalyst.expressions.ArrayContains"))
   }
+
+  test("RENAME_SRC_PATH_NOT_FOUND: rename the file which source path does not exist") {

Review Comment:
   Could you move the test from `*Compilation*Suite` to `QueryExecutionErrorsSuite`, please.



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] AmplabJenkins commented on pull request #37611: [SPARK-38749][SQL][TESTS] Test the error class: RENAME_SRC_PATH_NOT_FOUND

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on PR #37611:
URL: https://github.com/apache/spark/pull/37611#issuecomment-1223283362

   Can one of the admins verify this patch?


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] MaxGekk commented on a diff in pull request #37611: [SPARK-38749][SQL][TESTS] Test the error class: RENAME_SRC_PATH_NOT_FOUND

Posted by GitBox <gi...@apache.org>.
MaxGekk commented on code in PR #37611:
URL: https://github.com/apache/spark/pull/37611#discussion_r955785609


##########
sql/core/src/test/scala/org/apache/spark/sql/errors/QueryExecutionErrorsSuite.scala:
##########
@@ -686,6 +689,31 @@ class QueryExecutionErrorsSuite
       ),
       sqlState = "0A000")
   }
+
+  test("RENAME_SRC_PATH_NOT_FOUND: rename the file which source path does not exist") {
+    var srcPath: Path = null
+    val e = intercept[SparkFileNotFoundException](
+      withTempPath { p =>
+        val conf = new Configuration()
+        conf.set("fs.test.impl", classOf[RenameReturnsFalseFileSystem].getName)
+        conf.set("fs.defaultFS", "test:///")
+        val basePath = new Path(p.getAbsolutePath)
+        val fm = new FileSystemBasedCheckpointFileManager(basePath, conf)
+        srcPath = new Path(s"$basePath/file")
+        assert(!fm.exists(srcPath))
+        fm.createAtomic(srcPath, overwriteIfPossible = true).cancel()
+        assert(!fm.exists(srcPath))
+        val dstPath = new Path(s"$basePath/new_file")
+        fm.renameTempFile(srcPath, dstPath, true)
+      }
+    )
+    checkError(
+      exception = e,
+      errorClass = "RENAME_SRC_PATH_NOT_FOUND",
+      parameters = Map(
+        "sourcePath" -> s"$srcPath"

Review Comment:
   nit:
   ```suggestion
           "sourcePath" -> srcPath
   ```



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] lvshaokang commented on pull request #37611: [SPARK-38749][SQL][TESTS] Test the error class: RENAME_SRC_PATH_NOT_FOUND

Posted by GitBox <gi...@apache.org>.
lvshaokang commented on PR #37611:
URL: https://github.com/apache/spark/pull/37611#issuecomment-1225934347

   @MaxGekk I've resolved conflicts. PTAL. 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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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