This is your code (it applied the "print" before the aggregation is done)

> ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();    
>  DataSet<Orders> orders=(DataSet<Orders>)
> env.readCsvFile("/home/hadoop/Desktop/Dataset/orders.csv")
>       .fieldDelimiter('|')
>       .includeFields(mask).ignoreFirstLine()
>       .tupleType(get_Order().getClass());
>        orders.aggregate(Aggregations.MAX, 2)  ;
> 
> orders.print();    

You need to put the print direct after the aggregate() of use a new
variable:

  orders.aggregate(Aggregations.MAX, 2).print();

or

  DataSet<Orders> aggedOrders = orders.aggregate(Aggregations.MAX, 2);
  aggedOrders.print();


-Matthias

On 07/08/2015 10:30 PM, hagersaleh wrote:
> I did not understand what you mean
> 
> 
> 
> --
> View this message in context: 
> http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/why-when-use-orders-aggregate-Aggregations-MAX-2-not-return-one-value-but-return-more-value-tp1977p1989.html
> Sent from the Apache Flink User Mailing List archive. mailing list archive at 
> Nabble.com.
> 

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to