Package org.apache.flink.api.java

Examples of org.apache.flink.api.java.ExecutionEnvironment.execute()


    DataSet<Integer> result = data.reduceGroup(new PickOneAllReduce()).withBroadcastSet(iteration, "bc");
   
    final List<Integer> resultList = new ArrayList<Integer>();
    iteration.closeWith(result).output(new LocalCollectionOutputFormat<Integer>(resultList));
   
    env.execute();
   
    Assert.assertEquals(8, resultList.get(0).intValue());
  }

 
View Full Code Here


        DataSet<Tuple5<Integer, Long, Integer, String, Long>> ds = CollectionDataSets.get5TupleDataSet(env);
        DataSet<Tuple5<Integer, Long, Integer, String, Long>> ds2 = CollectionDataSets.get5TupleDataSet(env);
        DataSet<Tuple2<Integer, Integer>> coGroupDs = ds.coGroup(ds2).where(0).equalTo(0).with(new Tuple5CoGroup());
       
        coGroupDs.writeAsCsv(resultPath);
        env.execute();
       
        // return expected result
        return "1,0\n" +
            "2,6\n" +
            "3,24\n" +
View Full Code Here

                    return in.myInt;
                  }
                }).with(new CustomTypeCoGroup());
       
        coGroupDs.writeAsText(resultPath);
        env.execute();
       
        // return expected result
        return "1,0,test\n" +
            "2,6,test\n" +
            "3,24,test\n" +
View Full Code Here

        DataSet<Tuple3<Integer, Long, String>> ds = CollectionDataSets.get3TupleDataSet(env);
        DataSet<Tuple3<Integer, Long, String>> ds2 = CollectionDataSets.get3TupleDataSet(env);
        DataSet<Tuple3<Integer, Long, String>> coGroupDs = ds.coGroup(ds2).where(0).equalTo(0).with(new Tuple3ReturnLeft());
       
        coGroupDs.writeAsCsv(resultPath);
        env.execute();
       
        // return expected result
        return "1,1,Hi\n" +
            "2,2,Hello\n" +
            "3,2,Hello world\n" +
View Full Code Here

        DataSet<Tuple5<Integer, Long, Integer, String, Long>> ds = CollectionDataSets.get5TupleDataSet(env);
        DataSet<Tuple5<Integer, Long, Integer, String, Long>> ds2 = CollectionDataSets.get5TupleDataSet(env);
        DataSet<Tuple5<Integer, Long, Integer, String, Long>> coGroupDs = ds.coGroup(ds2).where(0).equalTo(0).with(new Tuple5ReturnRight());
       
        coGroupDs.writeAsCsv(resultPath);
        env.execute();
       
        // return expected result
        return "1,1,0,Hallo,1\n" +
            "2,2,1,Hallo Welt,2\n" +
            "2,3,2,Hallo Welt wie,1\n" +
View Full Code Here

        DataSet<Tuple5<Integer, Long, Integer, String, Long>> ds = CollectionDataSets.get5TupleDataSet(env);
        DataSet<Tuple5<Integer, Long, Integer, String, Long>> ds2 = CollectionDataSets.get5TupleDataSet(env);
        DataSet<Tuple3<Integer, Integer, Integer>> coGroupDs = ds.coGroup(ds2).where(0).equalTo(0).with(new Tuple5CoGroupBC()).withBroadcastSet(intDs, "ints");
       
        coGroupDs.writeAsCsv(resultPath);
        env.execute();
       
        // return expected result
        return "1,0,55\n" +
            "2,6,55\n" +
            "3,24,55\n" +
View Full Code Here

                    return in.myInt;
                  }
                }).with(new MixedCoGroup());
       
        coGroupDs.writeAsCsv(resultPath);
        env.execute();
       
        // return expected result
        return "0,1,test\n" +
            "1,2,test\n" +
            "2,5,test\n" +
View Full Code Here

                    return in.myInt;
                  }
                }).equalTo(2).with(new MixedCoGroup2());
       
        coGroupDs.writeAsText(resultPath);
        env.execute();
       
        // return expected result
        return "0,1,test\n" +
            "1,2,test\n" +
            "2,5,test\n" +
View Full Code Here

       
        DataSet<Tuple3<Integer, Long, String>> coGrouped = ds1.coGroup(ds2).
            where(0,4).equalTo(0,1).with(new Tuple5Tuple3CoGroup());
       
        coGrouped.writeAsCsv(resultPath);
        env.execute();
       
        return "1,1,Hallo\n" +
            "2,2,Hallo Welt\n" +
            "3,2,Hallo Welt wie gehts?\n" +
            "3,2,ABC\n" +
View Full Code Here

                return new Tuple2<Integer, Long>(t.f0, t.f1);
              }
            }).with(new Tuple5Tuple3CoGroup());
       
        coGrouped.writeAsCsv(resultPath);
        env.execute();
       
        return "1,1,Hallo\n" +
            "2,2,Hallo Welt\n" +
            "3,2,Hallo Welt wie gehts?\n" +
            "3,2,ABC\n" +
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.