Examples of fromCollection()


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

 
  @Test
  public void testProjectionTypes() {
   
    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    DataSet<Tuple5<Integer, Long, String, Long, Integer>> tupleDs = env.fromCollection(emptyTupleData, tupleTypeInfo);

    // should work
    try {
      tupleDs.project(0).types(Integer.class);
    } catch(Exception e) {
View Full Code Here

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

 
  @Test 
  public void testGroupByKeyFields1() {
   
    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    DataSet<Tuple5<Integer, Long, String, Long, Integer>> tupleDs = env.fromCollection(emptyTupleData, tupleTypeInfo);

    // should work
    try {
      tupleDs.groupBy(0);
    } catch(Exception e) {
View Full Code Here

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

  @Test(expected = InvalidProgramException.class
  public void testGroupByKeyFields2() {
   
    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

    DataSet<Long> longDs = env.fromCollection(emptyLongData, BasicTypeInfo.LONG_TYPE_INFO);
    // should not work: groups on basic type
    longDs.groupBy(0);
  }
 
  @Test(expected = InvalidProgramException.class
View Full Code Here

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

   
    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
   
    this.customTypeData.add(new CustomType());
   
    DataSet<CustomType> customDs = env.fromCollection(customTypeData);
    // should not work: groups on custom type
    customDs.groupBy(0);
   
  }
 
View Full Code Here

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

 
  @Test(expected = IllegalArgumentException.class)
  public void testGroupByKeyFields4() {
   
    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    DataSet<Tuple5<Integer, Long, String, Long, Integer>> tupleDs = env.fromCollection(emptyTupleData, tupleTypeInfo);

    // should not work, key out of tuple bounds
    tupleDs.groupBy(5);
  }
 
View Full Code Here

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

 
  @Test(expected = IllegalArgumentException.class)
  public void testGroupByKeyFields5() {
   
    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    DataSet<Tuple5<Integer, Long, String, Long, Integer>> tupleDs = env.fromCollection(emptyTupleData, tupleTypeInfo);

    // should not work, negative field position
    tupleDs.groupBy(-1);
  }
View Full Code Here

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

    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

    this.customTypeData.add(new CustomType());

    DataSet<CustomType> ds = env.fromCollection(customTypeData);

    // should work
    try {
      ds.groupBy("myInt");
    } catch(Exception e) {
View Full Code Here

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

  @Test(expected = IllegalArgumentException.class)
  public void testGroupByKeyExpressions2() {

    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

    DataSet<Long> longDs = env.fromCollection(emptyLongData, BasicTypeInfo.LONG_TYPE_INFO);
    // should not work: groups on basic type
    longDs.groupBy("myInt");
  }

  @Test(expected = InvalidProgramException.class)
View Full Code Here

Examples of org.apache.flink.streaming.api.environment.LocalStreamEnvironment.fromCollection()

    crossExpectedResults.add(new Tuple2<Tuple2<Integer, String>, Integer>(
        new Tuple2<Integer, String>(0, "y"), 5));
    crossExpectedResults.add(new Tuple2<Tuple2<Integer, String>, Integer>(
        new Tuple2<Integer, String>(0, "y"), 20));

    DataStream<Tuple2<Integer, String>> inStream1 = env.fromCollection(in1);
    DataStream<Integer> inStream2 = env.fromCollection(in2);

    inStream1.windowJoin(inStream2, 1000, 1000, new MyTimestamp1(), new MyTimestamp2(), 0, 0)
        .addSink(new JoinResultSink());
View Full Code Here

Examples of org.apache.flink.streaming.api.environment.LocalStreamEnvironment.fromCollection()

        new Tuple2<Integer, String>(0, "y"), 5));
    crossExpectedResults.add(new Tuple2<Tuple2<Integer, String>, Integer>(
        new Tuple2<Integer, String>(0, "y"), 20));

    DataStream<Tuple2<Integer, String>> inStream1 = env.fromCollection(in1);
    DataStream<Integer> inStream2 = env.fromCollection(in2);

    inStream1.windowJoin(inStream2, 1000, 1000, new MyTimestamp1(), new MyTimestamp2(), 0, 0)
        .addSink(new JoinResultSink());

    inStream1.windowCross(inStream2, 1000, 1000, new MyTimestamp1(), new MyTimestamp2())
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.