Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/4980#discussion_r28414608
--- Diff:
sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveWriterContainers.scala ---
@@ -234,7 +234,13 @@ private[spark] class
SparkHiveDynamicPartitionWriterContainer(
val outputPath = FileOutputFormat.getOutputPath(conf.value)
assert(outputPath != null, "Undefined job output-path")
val workPath = new Path(outputPath,
dynamicPartPath.stripPrefix("/"))
- new Path(workPath, getOutputName)
+ val path = new Path(workPath, getOutputName)
+ val fs = path.getFileSystem(conf.value)
+ // this judgement is added for SPARK-6067
+ if (fs.exists(path) && path.toUri.toString.indexOf("part-") > 0) {
--- End diff --
Maybe check for `part-` before getting a file system or checking if the
file exists. This saves RPCs.
Did you mean `> 0` in the sense of `contains`? that's not quite correct if
so, since the condition should be `>= 0`. But then `contains` would be simpler
anyway.
Finally, duplicat -> duplicate
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]