You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@storm.apache.org by "Sachin Pasalkar (JIRA)" <ji...@apache.org> on 2017/01/16 13:57:26 UTC

[jira] [Created] (STORM-2295) KafkaSpoutStreamsNamedTopics changing the sequence of fields name while emitting data

Sachin Pasalkar created STORM-2295:
--------------------------------------

             Summary: KafkaSpoutStreamsNamedTopics changing the sequence of fields name while emitting data
                 Key: STORM-2295
                 URL: https://issues.apache.org/jira/browse/STORM-2295
             Project: Apache Storm
          Issue Type: Bug
          Components: storm-kafka-client
    Affects Versions: 1.0.0
            Reporter: Sachin Pasalkar
            Priority: Blocker


If you look at below code *allFields* variable is HashSet. To which we have added the o/p of *kafkaSpoutStream.getOutputFields().toList()*. That sort data on hash basis rather than keeping same sequence.
{code:java}
	@Override
	public Fields getOutputFields() {
		final Set<String> allFields = new HashSet<>();
		for (KafkaSpoutStream kafkaSpoutStream : topicToStream.values()) {
			allFields.addAll(kafkaSpoutStream.getOutputFields().toList());
		}
		return new Fields(new ArrayList<>(allFields));
	}
{code}

Changes needed is below
{code:java}
final Set<String> allFields = new LinkedHashSet<>();
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)