SOLR-10559: Fix TupStream to respect field order

This commit is contained in:
Joel Bernstein 2017-05-01 12:32:37 -04:00
parent 0a2286c5f2
commit ee8ce57e51
1 changed files with 8 additions and 1 deletions

View File

@ -46,6 +46,8 @@ public class TupStream extends TupleStream implements Expressible {
private Map<String,String> stringParams = new HashMap<>(); private Map<String,String> stringParams = new HashMap<>();
private Map<String,StreamEvaluator> evaluatorParams = new HashMap<>(); private Map<String,StreamEvaluator> evaluatorParams = new HashMap<>();
private Map<String,TupleStream> streamParams = new HashMap<>(); private Map<String,TupleStream> streamParams = new HashMap<>();
private List<String> fieldNames = new ArrayList();
private Map<String, String> fieldLabels = new HashMap();
private boolean finished; private boolean finished;
@ -55,6 +57,8 @@ public class TupStream extends TupleStream implements Expressible {
//Get all the named params //Get all the named params
for(StreamExpressionNamedParameter np : namedParams) { for(StreamExpressionNamedParameter np : namedParams) {
String name = np.getName(); String name = np.getName();
fieldNames.add(name);
fieldLabels.put(name, name);
StreamExpressionParameter param = np.getParameter(); StreamExpressionParameter param = np.getParameter();
// we're going to split these up here so we only make the choice once // we're going to split these up here so we only make the choice once
@ -186,7 +190,10 @@ public class TupStream extends TupleStream implements Expressible {
} }
} }
return new Tuple(values); Tuple tup = new Tuple(values);
tup.fieldNames = fieldNames;
tup.fieldLabels = fieldLabels;
return tup;
} }
} }