storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kabh...@apache.org
Subject [1/2] storm git commit: PMMLPredictorBolt - Handle duplicate output and predicted fields
Date Mon, 09 Jan 2017 02:47:08 GMT
Repository: storm
Updated Branches:
  refs/heads/master 70102643e -> e34c3ffc7


PMMLPredictorBolt - Handle duplicate output and predicted fields


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/daf63f6f
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/daf63f6f
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/daf63f6f

Branch: refs/heads/master
Commit: daf63f6ffd7ffcc88cf0d46c38b91e2988f70ce3
Parents: 6b92d23
Author: Hugo Louro <hmclouro@gmail.com>
Authored: Wed Jan 4 14:13:14 2017 -0800
Committer: Hugo Louro <hmclouro@gmail.com>
Committed: Wed Jan 4 14:13:14 2017 -0800

----------------------------------------------------------------------
 .../org/apache/storm/pmml/model/jpmml/JpmmlModelOutputs.java   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/daf63f6f/external/storm-pmml/src/main/java/org/apache/storm/pmml/model/jpmml/JpmmlModelOutputs.java
----------------------------------------------------------------------
diff --git a/external/storm-pmml/src/main/java/org/apache/storm/pmml/model/jpmml/JpmmlModelOutputs.java
b/external/storm-pmml/src/main/java/org/apache/storm/pmml/model/jpmml/JpmmlModelOutputs.java
index 46d2e3d..0b507d4 100644
--- a/external/storm-pmml/src/main/java/org/apache/storm/pmml/model/jpmml/JpmmlModelOutputs.java
+++ b/external/storm-pmml/src/main/java/org/apache/storm/pmml/model/jpmml/JpmmlModelOutputs.java
@@ -30,9 +30,11 @@ import java.io.File;
 import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
+import java.util.Set;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
@@ -102,7 +104,7 @@ public class JpmmlModelOutputs implements ModelOutputs {
     // ======
 
     private static ModelOutputs create(PMML pmmlModel, List<String> streams) {
-        final List<String> fieldNames = new ArrayList<>();
+        final Set<String> fieldNames = new LinkedHashSet<>();
         final Evaluator evaluator = JpmmlFactory.newEvaluator(pmmlModel);
 
         for (FieldName predictedField : evaluator.getPredictedFields()) {
@@ -114,7 +116,7 @@ public class JpmmlModelOutputs implements ModelOutputs {
         }
 
         final Map<String, Fields> toDeclare = streams.stream()
-                .collect(Collectors.toMap(Function.identity(), (x) -> new Fields(fieldNames)));
+                .collect(Collectors.toMap(Function.identity(), (x) -> new Fields(new ArrayList<>(fieldNames))));
 
         return new JpmmlModelOutputs(toDeclare);
     }


Mime
View raw message