James Xu created STORM-101:
------------------------------

             Summary: Merging two streams with the same fields in a different 
order results in the wrong values being returned when getting tuple values by 
index
                 Key: STORM-101
                 URL: https://issues.apache.org/jira/browse/STORM-101
             Project: Apache Storm (Incubating)
          Issue Type: Bug
            Reporter: James Xu
            Priority: Minor


https://github.com/nathanmarz/storm/issues/688

Given the following topology (Constant is a function that simply injects a 
constant into the tuple):

    TridentTopology topology = new TridentTopology();

    List<Object> tuple = Arrays.<Object>asList(10);

    Stream stream = topology.newStream("spout", new FixedBatchSpout(new 
Fields("trigger"), 1, tuple));

    Stream s1 = stream
            .each(new Constant("StringVal"), new Fields("string"))
            .each(new Constant(20), new Fields("number"));

    Stream s2 = stream
            .each(new Constant(20), new Fields("number"))
            .each(new Constant("StringVal"), new Fields("string"));

    topology.merge(s1, s2).each(new Fields("string"), new Debug());
What I expect to be output:

DEBUG: [StringVal]
DEBUG: [StringVal]

What is actually output:

DEBUG: [StringVal]
DEBUG: [20]

I expect the field selector for the input to Debug to pick the first field for 
the tuple from s1, and the second field for the tuple from s2.



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Reply via email to