You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by Spico Florin <sp...@gmail.com> on 2014/01/21 14:34:51 UTC

Question about the tuple definition

Hello!
   According to the definition of the tuple  as stated in
http://nathanmarz.github.io/storm/doc/backtype/storm/tuple/Tuple.html
" tuple is a named list of values, where each value can be any type". As
I'm newbie in Storm my question is simple: What is giving the name of the
tuple? The streamId or the name of the fields for each defined value?
Please give an example with the named list.
 As I could see in some examples,the tuple looks like a list of values :
   ("smith","27","ABCQN")
 but there is no  name.
  I look forward for your answers.
Thank you
  Regards,
 Florin

Re: Question about the tuple definition

Posted by Spico Florin <sp...@gmail.com>.
Hello, Richard!
  Thank you very much for your response. I was thinking to the same
explication but I tried to double check.
 Regards,
 Florin


On Tue, Jan 21, 2014 at 4:20 PM, Richards Peter <hb...@gmail.com>wrote:

> Hi,
>
> To keep it simple I would say that a tuple is a kind of key-value pair. In
> storm the list of keys(or names) is defined in the declareOutputFields().
> In word count topology the names can be ("word","count").
>
> Every value which is emitted from the spout or bolt is associated with the
> name declared in the declareOutputFields(). So if a tuple emitted in the
> above example is ("sample",1), then sample is the word and 1 is the count.
> In this example you will notice that the values emitted are of types String
> and Integer. You need not specify the type of the value which is emitted
> from the spout or bolt.
>
> Regards,
> Richards Peter.
>

Re: Question about the tuple definition

Posted by Richards Peter <hb...@gmail.com>.
Hi,

To keep it simple I would say that a tuple is a kind of key-value pair. In
storm the list of keys(or names) is defined in the declareOutputFields().
In word count topology the names can be ("word","count").

Every value which is emitted from the spout or bolt is associated with the
name declared in the declareOutputFields(). So if a tuple emitted in the
above example is ("sample",1), then sample is the word and 1 is the count.
In this example you will notice that the values emitted are of types String
and Integer. You need not specify the type of the value which is emitted
from the spout or bolt.

Regards,
Richards Peter.