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:02 GMT
Repository: storm
Updated Branches:
  refs/heads/1.x-branch a8d805121 -> 893854d2e


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/4c3c4962
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/4c3c4962
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/4c3c4962

Branch: refs/heads/1.x-branch
Commit: 4c3c4962ea591705c385ee86fff159c09f22ad02
Parents: 00d2074
Author: Hugo Louro <hmclouro@gmail.com>
Authored: Wed Jan 4 14:27:35 2017 -0800
Committer: Hugo Louro <hmclouro@gmail.com>
Committed: Wed Jan 4 14:27:35 2017 -0800

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


http://git-wip-us.apache.org/repos/asf/storm/blob/4c3c4962/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 48510ef..bd23275 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
@@ -31,6 +31,7 @@ import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
@@ -106,7 +107,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()) {
@@ -119,7 +120,7 @@ public class JpmmlModelOutputs implements ModelOutputs {
 
         final Map<String, Fields> toDeclare = new LinkedHashMap<>();
         for (String stream : streams) {
-            toDeclare.put(stream, new Fields(fieldNames));
+            toDeclare.put(stream, new Fields(new ArrayList<>(fieldNames)));
         }
 
         return new JpmmlModelOutputs(toDeclare);


Mime
View raw message