georgepachitariu commented on a change in pull request #1294:
URL: https://github.com/apache/hive/pull/1294#discussion_r458678610



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java
##########
@@ -1459,8 +1459,12 @@ public static void mvFileToFinalPath(Path specPath, 
Configuration hconf,
       }
 
       // Remove duplicates from tmpPath
-      List<FileStatus> statusList = HiveStatsUtils.getFileStatusRecurse(
-          tmpPath, ((dpCtx == null) ? 1 : dpCtx.getNumDPCols()), fs);
+      int level = dpCtx == null ? 1 : dpCtx.getNumDPCols();
+      // - when execution engine is Tez and the query uses sql clause "Union"
+      //   there is an extra layer of subdirectories that contains the 
branches of the union;
+      boolean isUnionClauseInTez = 
conf.getDirName().toString().contains(AbstractFileMergeOperator.UNION_SUDBIR_PREFIX);

Review comment:
       Thank you :)
   We discovered this the hard way: seeing that we sometimes get duplicates in 
specific Hive scripts we have in production.




----------------------------------------------------------------
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



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

Reply via email to