Examples of fromCollection()


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

 
  @Test
  public void testAggregationTypes() {
    try {
      final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
      DataSet<Tuple5<Integer, Long, String, Long, Integer>> tupleDs = env.fromCollection(emptyTupleData, tupleTypeInfo);
     
      // should work: multiple aggregates
      tupleDs.aggregate(Aggregations.SUM, 0).and(Aggregations.MIN, 4);

      // should work: nested aggregates
View Full Code Here

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

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

    // should not work, cogroup key fields on custom type
    ds1.coGroup(ds2).where(5).equalTo(0);
  }
View Full Code Here

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

  @Test
  public void testCoGroupKeyExpressions1() {

    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    DataSet<CustomType> ds1 = env.fromCollection(customTypeData);
    DataSet<CustomType> ds2 = env.fromCollection(customTypeData);

    // should work
    try {
      ds1.coGroup(ds2).where("myInt").equalTo("myInt");
View Full Code Here

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

  @Test
  public void testCoGroupKeyExpressions1() {

    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    DataSet<CustomType> ds1 = env.fromCollection(customTypeData);
    DataSet<CustomType> ds2 = env.fromCollection(customTypeData);

    // should work
    try {
      ds1.coGroup(ds2).where("myInt").equalTo("myInt");
    } catch(Exception e) {
View Full Code Here

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

  @Test(expected = InvalidProgramException.class)
  public void testCoGroupKeyExpressions2() {

    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    DataSet<CustomType> ds1 = env.fromCollection(customTypeData);
    DataSet<CustomType> ds2 = env.fromCollection(customTypeData);

    // should not work, incompatible cogroup key types
    ds1.coGroup(ds2).where("myInt").equalTo("myString");
  }
View Full Code Here

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

  @Test(expected = InvalidProgramException.class)
  public void testCoGroupKeyExpressions2() {

    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    DataSet<CustomType> ds1 = env.fromCollection(customTypeData);
    DataSet<CustomType> ds2 = env.fromCollection(customTypeData);

    // should not work, incompatible cogroup key types
    ds1.coGroup(ds2).where("myInt").equalTo("myString");
  }
View Full Code Here

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

  @Test(expected = InvalidProgramException.class)
  public void testCoGroupKeyExpressions3() {

    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    DataSet<CustomType> ds1 = env.fromCollection(customTypeData);
    DataSet<CustomType> ds2 = env.fromCollection(customTypeData);

    // should not work, incompatible number of cogroup keys
    ds1.coGroup(ds2).where("myInt", "myString").equalTo("myString");
  }
View Full Code Here

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

  @Test(expected = InvalidProgramException.class)
  public void testCoGroupKeyExpressions3() {

    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    DataSet<CustomType> ds1 = env.fromCollection(customTypeData);
    DataSet<CustomType> ds2 = env.fromCollection(customTypeData);

    // should not work, incompatible number of cogroup keys
    ds1.coGroup(ds2).where("myInt", "myString").equalTo("myString");
  }
View Full Code Here

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

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

    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    DataSet<CustomType> ds1 = env.fromCollection(customTypeData);
    DataSet<CustomType> ds2 = env.fromCollection(customTypeData);

    // should not work, cogroup key non-existent
    ds1.coGroup(ds2).where("myNonExistent").equalTo("myInt");
  }
View Full Code Here

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

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

    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    DataSet<CustomType> ds1 = env.fromCollection(customTypeData);
    DataSet<CustomType> ds2 = env.fromCollection(customTypeData);

    // should not work, cogroup key non-existent
    ds1.coGroup(ds2).where("myNonExistent").equalTo("myInt");
  }
 
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.