aturoczy commented on code in PR #4520:
URL: https://github.com/apache/hive/pull/4520#discussion_r1277237095
##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMapRedUtils.java:
##########
@@ -1309,12 +1312,29 @@ 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;
+ FileSystem fs;
+ try {
+ fs = inputDirName.getFileSystem(conf);
+ if (fsInputDesc.isCTASorCM() &&
fsInputDesc.getTable().getTableType().equals(TableType.EXTERNAL_TABLE)
+ && BlobStorageUtils.isBlobStorageFileSystem(conf, fs)
+ && !Utilities.shouldAvoidRename(fsInputDesc, conf)) {
+ changeToTmpPath = true;
+ }
+ } catch (IOException e) {
+ throw new RuntimeException("Unable to get filesystem from path due to:
", e);
Review Comment:
Is this a common practice to pack the IOException to RuntimeException?
##########
ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java:
##########
@@ -1039,7 +1039,7 @@ public static List<String> mergeUniqElems(List<String>
src, List<String> dest) {
return src;
}
- private static final String tmpPrefix = "_tmp.";
+ private static final String tmpPrefix = "-tmp.";
private static final String taskTmpPrefix = "_task_tmp.";
Review Comment:
Just asking. Above the tempPrefix is -tmp here it is _task_tmp is this OK?
##########
ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java:
##########
@@ -1039,7 +1039,7 @@ public static List<String> mergeUniqElems(List<String>
src, List<String> dest) {
return src;
}
- private static final String tmpPrefix = "_tmp.";
+ private static final String tmpPrefix = "-tmp.";
private static final String taskTmpPrefix = "_task_tmp.";
Review Comment:
Also, what will happen after Hive upgrade? Would not be something
incompatible? IE: Remaning temp file?
--
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]