Package org.apache.flink.api.java

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


                }             
              }
            });
       
        inputObjFlatMapDs.writeAsCsv(resultPath);
        env.execute();
       
        // return expected result
        return  "0,1,Hi\n" +
            "0,2,Hello\n" + "1,2,Hello\n" +
            "0,2,Hello world\n" + "1,2,Hello world\n" + "2,2,Hello world\n" +
View Full Code Here


                outTuple.setFields(f2Replace, value.f1, value.f2);
                out.collect(outTuple);
              }
            }).withBroadcastSet(ints, "ints");
        bcFlatMapDs.writeAsCsv(resultPath);
        env.execute();
       
        // return expected result
        return   "55,1,Hi\n" +
            "55,2,Hello\n" +
            "55,2,Hello world\n" +
View Full Code Here

    DataSet<Tuple2<Long, Double>> result = MultipleJoinsWithSolutionSetCompilerTest.constructPlan(initialData, NUM_ITERS);
   
    List<Tuple2<Long, Double>> resultCollector = new ArrayList<Tuple2<Long,Double>>();
    result.output(new LocalCollectionOutputFormat<Tuple2<Long,Double>>(resultCollector));
   
    env.execute();
   
    for (Tuple2<Long, Double> tuple : resultCollector) {
      Assert.assertEquals(expectedFactor * tuple.f0, tuple.f1.doubleValue(), 0.0);
    }
  }
View Full Code Here

        DataSet<Tuple3<Integer, Long, String>> ds = CollectionDataSets.get3TupleDataSet(env);
        DataSet<Tuple3<Integer, Long, String>> reduceDs = ds.
            groupBy(1).reduce(new Tuple3Reduce("B-)"));
       
        reduceDs.writeAsCsv(resultPath);
        env.execute();
       
        // return expected result
        return "1,1,Hi\n" +
            "5,2,B-)\n" +
            "15,3,B-)\n" +
View Full Code Here

        DataSet<Tuple5<Integer, Long, Integer, String, Long>> ds = CollectionDataSets.get5TupleDataSet(env);
        DataSet<Tuple5<Integer, Long, Integer, String, Long>> reduceDs = ds.
            groupBy(4,0).reduce(new Tuple5Reduce());
       
        reduceDs.writeAsCsv(resultPath);
        env.execute();
       
        // return expected result
        return "1,1,0,Hallo,1\n" +
            "2,3,2,Hallo Welt wie,1\n" +
            "2,2,1,Hallo Welt,2\n" +
View Full Code Here

                    return in.f1;
                  }
                }).reduce(new Tuple3Reduce("B-)"));
       
        reduceDs.writeAsCsv(resultPath);
        env.execute();
       
        // return expected result
        return "1,1,Hi\n" +
            "5,2,B-)\n" +
            "15,3,B-)\n" +
View Full Code Here

                    return in.myInt;
                  }
                }).reduce(new CustomTypeReduce());
       
        reduceDs.writeAsText(resultPath);
        env.execute();
       
        // return expected result
        return "1,0,Hi\n" +
            "2,3,Hello!\n" +
            "3,12,Hello!\n" +
View Full Code Here

        DataSet<Tuple3<Integer, Long, String>> ds = CollectionDataSets.get3TupleDataSet(env);
        DataSet<Tuple3<Integer, Long, String>> reduceDs = ds.
            reduce(new AllAddingTuple3Reduce());
       
        reduceDs.writeAsCsv(resultPath);
        env.execute();
       
        // return expected result
        return "231,91,Hello World\n";
      }
      case 6: {
View Full Code Here

        DataSet<CustomType> ds = CollectionDataSets.getCustomTypeDataSet(env);
        DataSet<CustomType> reduceDs = ds.
            reduce(new AllAddingCustomTypeReduce());
       
        reduceDs.writeAsText(resultPath);
        env.execute();
       
        // return expected result
        return "91,210,Hello!";
      }
      case 7: {
View Full Code Here

        DataSet<Tuple3<Integer, Long, String>> ds = CollectionDataSets.get3TupleDataSet(env);
        DataSet<Tuple3<Integer, Long, String>> reduceDs = ds.
            groupBy(1).reduce(new BCTuple3Reduce()).withBroadcastSet(intDs, "ints");
       
        reduceDs.writeAsCsv(resultPath);
        env.execute();
       
        // return expected result
        return "1,1,Hi\n" +
            "5,2,55\n" +
            "15,3,55\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.