dongjoon-hyun commented on a change in pull request #28232: 
[SPARK-31459][SQL]fix insert overwrite directory target path is an existing file
URL: https://github.com/apache/spark/pull/28232#discussion_r410594226
 
 

 ##########
 File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/InsertSuite.scala
 ##########
 @@ -769,6 +769,30 @@ class InsertSuite extends QueryTest with 
TestHiveSingleton with BeforeAndAfter
     }
   }
 
+  test("SPARK-31459: fix insert overwrite directory target path is an existing 
file") {
+    withTempView("test_insert_table") {
+      spark.range(10).selectExpr("id", "id AS 
str").createOrReplaceTempView("test_insert_table")
+
+      withTempDir { dir =>
+        val tempFile = File.createTempFile("targetPath", "", dir)
+        val path = tempFile.toURI.getPath
+
+        sql(
+          s"""
+            |INSERT OVERWRITE LOCAL DIRECTORY '${path}'
 
 Review comment:
   There is no problem at `INSERT OVERWRITE LOCAL DIRECTORY` syntax.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to