This is an automated email from the ASF dual-hosted git repository.

codope pushed a commit to branch release-0.12.0
in repository https://gitbox.apache.org/repos/asf/hudi.git

commit 4970ab0417fb0f7d55938765b3cde6dbb0f48d68
Author: BruceLin <[email protected]>
AuthorDate: Tue Aug 9 13:29:00 2022 +0800

    [HUDI-4570] Fix hive sync path error due to reuse of storage descriptors. 
(#6329)
---
 .../src/main/java/org/apache/hudi/hive/ddl/HMSDDLExecutor.java       | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/ddl/HMSDDLExecutor.java
 
b/hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/ddl/HMSDDLExecutor.java
index ea01ffe15f..adb8ce988d 100644
--- 
a/hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/ddl/HMSDDLExecutor.java
+++ 
b/hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/ddl/HMSDDLExecutor.java
@@ -225,8 +225,9 @@ public class HMSDDLExecutor implements DDLExecutor {
         String fullPartitionPath = 
StorageSchemes.HDFS.getScheme().equals(partitionScheme)
             ? 
FSUtils.getDFSFullPartitionPath(syncConfig.getHadoopFileSystem(), 
partitionPath) : partitionPath.toString();
         List<String> partitionValues = 
partitionValueExtractor.extractPartitionValuesInPath(partition);
-        sd.setLocation(fullPartitionPath);
-        return new Partition(partitionValues, databaseName, tableName, 0, 0, 
sd, null);
+        StorageDescriptor partitionSd = sd.deepCopy();
+        partitionSd.setLocation(fullPartitionPath);
+        return new Partition(partitionValues, databaseName, tableName, 0, 0, 
partitionSd, null);
       }).collect(Collectors.toList());
       client.alter_partitions(databaseName, tableName, partitionList, null);
     } catch (TException e) {

Reply via email to