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 ea01ffe15f01a..adb8ce988d320 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 void updatePartitionsToTable(String tableName, List changedPartit String fullPartitionPath = StorageSchemes.HDFS.getScheme().equals(partitionScheme) ? FSUtils.getDFSFullPartitionPath(syncConfig.getHadoopFileSystem(), partitionPath) : partitionPath.toString(); List 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) {