You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by Martin Neumann <mn...@spotify.com> on 2014/10/15 15:53:51 UTC

How to group and sort the output of a join

Hej,

After a join operation I end up with a Tuple2<Tuple10<...>Tuple2<...>> I
now want to group it on field 1 from the first inner Tuple and then sort it
by field 1 in the 2nd inner tuple.

How do I do that? I think I need to use the key extractor to get the
correct field but sort does not take one.

cheers Martin

Re: How to group and sort the output of a join

Posted by Aljoscha Krettek <al...@apache.org>.
Hi,
this should be possible with:

.groupBy("f0.f0").sortGroup("f1.f0")

Robert recently did some work to allow accessing nested tuple fields
and fields of objects using string expressions. For tuple fields you
use "f0", "f1" and so on and the dot is used to access nested fields.

Cheers,
Aljoscha

On Wed, Oct 15, 2014 at 3:53 PM, Martin Neumann <mn...@spotify.com> wrote:
> Hej,
>
> After a join operation I end up with a Tuple2<Tuple10<...>Tuple2<...>> I
> now want to group it on field 1 from the first inner Tuple and then sort it
> by field 1 in the 2nd inner tuple.
>
> How do I do that? I think I need to use the key extractor to get the
> correct field but sort does not take one.
>
> cheers Martin