SourabhBadhya commented on code in PR #4520:
URL: https://github.com/apache/hive/pull/4520#discussion_r1280414962
##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java:
##########
@@ -1309,12 +1312,28 @@ public static void
createMRWorkForMergingFiles(FileSinkOperator fsInput,
// 2. Constructing a conditional task consisting of a move task and a map
reduce task
//
Path inputDirName = fsInputDesc.getMergeInputDirName();
+
+ // For external CTAS queries, there is an optimisation which avoids
rename/copy of
+ // files from -tmp to -ext. In such cases, the input dir must be -tmp.
+ boolean changeToTmpPath = false;
+ try {
+ FileSystem fs = inputDirName.getFileSystem(conf);
+ if (fsInputDesc.isCTASorCM() &&
fsInputDesc.getTable().getTableType().equals(TableType.EXTERNAL_TABLE)
+ && BlobStorageUtils.isBlobStorageFileSystem(conf, fs)
+ && !Utilities.shouldAvoidRename(fsInputDesc, conf)) {
+ changeToTmpPath = true;
Review Comment:
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]