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 2020/04/17 08:58:49 UTC
[GitHub] [spark] mcdull-zhang commented on a change in pull request #28232:
[SPARK-31459][SQL]fix insert overwrite directory target path is an existing
file
mcdull-zhang 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_r410088461
##########
File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/InsertIntoHiveDirCommand.scala
##########
@@ -90,6 +90,15 @@ case class InsertIntoHiveDirCommand(
val dfs = qualifiedPath.getFileSystem(hadoopConf)
(qualifiedPath, dfs)
}
+
+ if (fs.exists(writeToPath) && fs.isFile(writeToPath)) {
+ if (overwrite) {
+ fs.delete(writeToPath, true)
+ } else {
+ throw new SparkException(s"Failed inserting overwrite directory, " +
Review comment:
There is currently only insert overwrite directory syntax, overwrite must be true now, the code retains this parameter, I feel that the designer for future expansion.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org