You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by Raphael Hsieh <ra...@gmail.com> on 2014/07/02 19:27:44 UTC

key values in PersistentAggregate

>From my understanding, if I implement my own state factory to use in
PersistentAggregate, the grouping fields will be the key values in the
state,
However, if I want to have access to other fields in the aggregation, how
might I get those ? From my understanding, doing a groupBy() will create a
new GroupedStream which will only have the fields specified in the
groupBy().

Essentially what I want to do is:
stream
    .groupBy(new Fields("a"))
    .persistentAggregate(
        new Factory(),
        new Fields("b"),
        ...
    )

How would I do this ?

-- 
Raphael Hsieh

Re: key values in PersistentAggregate

Posted by Robert Lee <le...@gmail.com>.
Yes. GroupingBy simply allows you to select out of the existing fields you
have created within your TridentTopology. You still maintain access to all
the fields created within the stream that is being groupedBy.


On Wed, Jul 2, 2014 at 1:44 PM, Raphael Hsieh <ra...@gmail.com> wrote:

> actually I think this is a non-issue,
> given the field exists in the stream already, I should be able to access
> it right ?
>
>
> On Wed, Jul 2, 2014 at 10:27 AM, Raphael Hsieh <ra...@gmail.com>
> wrote:
>
>> From my understanding, if I implement my own state factory to use in
>> PersistentAggregate, the grouping fields will be the key values in the
>> state,
>> However, if I want to have access to other fields in the aggregation, how
>> might I get those ? From my understanding, doing a groupBy() will create a
>> new GroupedStream which will only have the fields specified in the
>> groupBy().
>>
>> Essentially what I want to do is:
>> stream
>>     .groupBy(new Fields("a"))
>>     .persistentAggregate(
>>         new Factory(),
>>         new Fields("b"),
>>         ...
>>     )
>>
>> How would I do this ?
>>
>> --
>> Raphael Hsieh
>>
>>
>>
>>
>
>
>
> --
> Raphael Hsieh
> Amazon.com
> Software Development Engineer I
> (978) 764-9014
>
>
>
>

Re: key values in PersistentAggregate

Posted by Raphael Hsieh <ra...@gmail.com>.
actually I think this is a non-issue,
given the field exists in the stream already, I should be able to access it
right ?


On Wed, Jul 2, 2014 at 10:27 AM, Raphael Hsieh <ra...@gmail.com> wrote:

> From my understanding, if I implement my own state factory to use in
> PersistentAggregate, the grouping fields will be the key values in the
> state,
> However, if I want to have access to other fields in the aggregation, how
> might I get those ? From my understanding, doing a groupBy() will create a
> new GroupedStream which will only have the fields specified in the
> groupBy().
>
> Essentially what I want to do is:
> stream
>     .groupBy(new Fields("a"))
>     .persistentAggregate(
>         new Factory(),
>         new Fields("b"),
>         ...
>     )
>
> How would I do this ?
>
> --
> Raphael Hsieh
>
>
>
>



-- 
Raphael Hsieh
Amazon.com
Software Development Engineer I
(978) 764-9014