You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@crunch.apache.org by Matthias Friedrich <ma...@mafr.de> on 2012/11/12 19:12:34 UTC
Aggregator properties
Hi,
I would guess that Aggregator implementations have to be associative
and commutative. Otherwise they can't be used in Combiners in a
deterministic way. Am I right?
If this is the case I'd suggest we add a big fat warning to our
StringConcatAggregator, because string concatenation isn't
commutative. Or maybe even remove it from our core API because it's a
bad role model?
Thanks,
Matthias
Re: Aggregator properties
Posted by Matthias Friedrich <ma...@mafr.de>.
Hmm, right, I didn't think about that. I'll add a warning.
Thanks,
Matthias
On Monday, 2012-11-12, Josh Wills wrote:
> Not necessarily-- you can use a secondary sort to make a non-commutative
> aggregator deterministic. But we should have a warning to that effect.
>
> J
>
>
> On Mon, Nov 12, 2012 at 10:12 AM, Matthias Friedrich <ma...@mafr.de> wrote:
>
> > Hi,
> >
> > I would guess that Aggregator implementations have to be associative
> > and commutative. Otherwise they can't be used in Combiners in a
> > deterministic way. Am I right?
> >
> > If this is the case I'd suggest we add a big fat warning to our
> > StringConcatAggregator, because string concatenation isn't
> > commutative. Or maybe even remove it from our core API because it's a
> > bad role model?
> >
> > Thanks,
> > Matthias
> >
Re: Aggregator properties
Posted by Josh Wills <jo...@gmail.com>.
Not necessarily-- you can use a secondary sort to make a non-commutative
aggregator deterministic. But we should have a warning to that effect.
J
On Mon, Nov 12, 2012 at 10:12 AM, Matthias Friedrich <ma...@mafr.de> wrote:
> Hi,
>
> I would guess that Aggregator implementations have to be associative
> and commutative. Otherwise they can't be used in Combiners in a
> deterministic way. Am I right?
>
> If this is the case I'd suggest we add a big fat warning to our
> StringConcatAggregator, because string concatenation isn't
> commutative. Or maybe even remove it from our core API because it's a
> bad role model?
>
> Thanks,
> Matthias
>