flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristoffer Sjögren <sto...@gmail.com>
Subject Sort tuple dataset
Date Sun, 15 Mar 2015 14:29:03 GMT
Hi

This is silly but I can't understand why the following code doesn't sort
the collection of integers. It seems to be reasonable thing to do from an
API perspective?

Cheers,
-Kristoffer

final ExecutionEnvironment env =
ExecutionEnvironment.getExecutionEnvironment();
    env.fromCollection(Lists.newArrayList(2,1,5,3,4,5)).map(new
MapFunction<Integer, Tuple1<Integer>>() {
      @Override
      public Tuple1<Integer> map(Integer value) throws Exception {
        return new Tuple1(value);
      }
    }).groupBy(0).sortGroup(0, Order.DESCENDING).getDataSet().print();
    env.execute();

Mime
View raw message