flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabian Hueske <fhue...@gmail.com>
Subject Re: sorting groups
Date Tue, 16 Jun 2015 21:43:03 GMT

the error is related to the way you specify the grouping and the sorting
The API is currently restricted in the way, that you can only use a key
selector function for the sorting key if you also used a selector function
for the grouping key.

In Scala the use of key selector functions is often not very obvious.

If you post the groupBy().sortGroup() command and the input type, I can
help you getting it right.

Cheers, Fabian

2015-06-16 23:37 GMT+02:00 Michele Bertoni <michele1.bertoni@mail.polimi.it>

> Hi everybody,
> I am trying to sorting a grouped dataset, but i am getting this error:
> Exception in thread "main"
> org.apache.flink.api.common.InvalidProgramException: Sorting on KeySelector
> keys only works with KeySelector grouping.
>         at
> org.apache.flink.api.scala.GroupedDataSet.sortGroup(GroupedDataSet.scala:113)
>         at
> it.polimi.genomics.flink.FlinkImplementation.regionOperation.OrderRD$.sort(OrderRD.scala:82)
>         …
> can anybody help me understanding the error?
> i have no idea what it means and google is not helpful in this case
> thanks!
> cheers
> Michele

View raw message