From f6756504ec14e7607bea475c77e5e3c1fea883a2 Mon Sep 17 00:00:00 2001 From: Tim Sell <63295+tims@users.noreply.github.com> Date: Mon, 14 Jan 2019 12:04:57 +0800 Subject: [PATCH] Deduplicate storage ids before we fetch them (#68) --- ingestion/src/main/java/feast/ingestion/model/Specs.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ingestion/src/main/java/feast/ingestion/model/Specs.java b/ingestion/src/main/java/feast/ingestion/model/Specs.java index 085fcc9436..5189f63130 100644 --- a/ingestion/src/main/java/feast/ingestion/model/Specs.java +++ b/ingestion/src/main/java/feast/ingestion/model/Specs.java @@ -19,6 +19,7 @@ import com.google.common.base.Preconditions; import com.google.common.collect.Lists; +import com.google.common.collect.Sets; import feast.ingestion.service.SpecService; import feast.specs.EntitySpecProto.EntitySpec; import feast.specs.FeatureSpecProto.FeatureSpec; @@ -30,6 +31,7 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Set; import lombok.Builder; import lombok.Getter; import lombok.ToString; @@ -63,7 +65,7 @@ public static Specs of(String jobName, ImportSpec importSpec, SpecService specSe specsBuilder.featureSpecs(specService.getFeatureSpecs(featureIds)); List entityNames = importSpec.getEntitiesList(); - List storageIds = Lists.newArrayList(); + Set storageIds = Sets.newHashSet(); for (FeatureSpec featureSpec : specsBuilder.featureSpecs.values()) { Preconditions.checkArgument( entityNames.contains(featureSpec.getEntity()),