From cfc9e956d1115de7bc12b931e736c439fb57460e Mon Sep 17 00:00:00 2001 From: mchades Date: Tue, 30 Jan 2024 21:27:58 +0800 Subject: [PATCH] change list to set --- .../gravitino/catalog/hive/HiveTableOperations.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/catalogs/catalog-hive/src/main/java/com/datastrato/gravitino/catalog/hive/HiveTableOperations.java b/catalogs/catalog-hive/src/main/java/com/datastrato/gravitino/catalog/hive/HiveTableOperations.java index 810ddeed4be..40244736650 100644 --- a/catalogs/catalog-hive/src/main/java/com/datastrato/gravitino/catalog/hive/HiveTableOperations.java +++ b/catalogs/catalog-hive/src/main/java/com/datastrato/gravitino/catalog/hive/HiveTableOperations.java @@ -18,7 +18,7 @@ import com.google.common.base.Preconditions; import java.io.IOException; import java.util.Arrays; -import java.util.List; +import java.util.Set; import java.util.stream.Collectors; import java.util.stream.IntStream; import org.apache.hadoop.hive.metastore.api.NoSuchObjectException; @@ -111,10 +111,10 @@ public Partition addPartition(Partition partition) throws PartitionAlreadyExists partition instanceof IdentityPartition, "Hive only supports identity partition"); IdentityPartition identityPartition = (IdentityPartition) partition; - List transformFields = + Set transformFields = Arrays.stream(table.partitioning()) .map(t -> ((Transforms.IdentityTransform) t).fieldName()[0]) - .collect(Collectors.toList()); + .collect(Collectors.toSet()); Preconditions.checkArgument( transformFields.size() == identityPartition.fieldNames().length,