Skip to content

Commit

Permalink
change list to set
Browse files Browse the repository at this point in the history
  • Loading branch information
mchades committed Jan 30, 2024
1 parent 756eb41 commit cfc9e95
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -111,10 +111,10 @@ public Partition addPartition(Partition partition) throws PartitionAlreadyExists
partition instanceof IdentityPartition, "Hive only supports identity partition");
IdentityPartition identityPartition = (IdentityPartition) partition;

List<String> transformFields =
Set<String> 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,
Expand Down

0 comments on commit cfc9e95

Please sign in to comment.