From 872f5798f43665c9c2adf9212c85e1d1733800db Mon Sep 17 00:00:00 2001 From: wuwenchi Date: Tue, 30 Apr 2024 21:22:52 +0800 Subject: [PATCH] [improvement](hive)add the `queryid` to the temporary file path (#34278) `_temp_` to `_temp__`. Prevent users from having a table with the name `_temp_`. So as to partition temp dir --- .../org/apache/doris/datasource/hive/HMSTransaction.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSTransaction.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSTransaction.java index 6fca8b4745feb9..824af6996a97bb 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSTransaction.java +++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HMSTransaction.java @@ -1187,7 +1187,8 @@ public void prepareAlterTable(TableAndMore tableAndMore) { String writePath = tableAndMore.getCurrentLocation(); if (!targetPath.equals(writePath)) { Path path = new Path(targetPath); - String oldTablePath = new Path(path.getParent(), "_temp_" + path.getName()).toString(); + String oldTablePath = new Path( + path.getParent(), "_temp_" + queryId + "_" + path.getName()).toString(); Status status = wrapperRenameDirWithProfileSummary( targetPath, oldTablePath, @@ -1342,7 +1343,8 @@ public void prepareAlterPartition(PartitionAndMore partitionAndMore) { if (!targetPath.equals(writePath)) { Path path = new Path(targetPath); - String oldPartitionPath = new Path(path.getParent(), "_temp_" + path.getName()).toString(); + String oldPartitionPath = new Path( + path.getParent(), "_temp_" + queryId + "_" + path.getName()).toString(); Status status = wrapperRenameDirWithProfileSummary( targetPath, oldPartitionPath,