Package org.apache.flink.api.java

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


  @Test
  public void testCoGroupKeyExpressions1Nested() {

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

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


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

    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("nested.myInt").equalTo("nested.myString");
  }
View Full Code Here

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

    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("nested.myInt").equalTo("nested.myString");
  }
View Full Code Here

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

    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("nested.myInt", "nested.myString").equalTo("nested.myString");
  }
View Full Code Here

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

    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("nested.myInt", "nested.myString").equalTo("nested.myString");
  }
View Full Code Here

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

    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("nested.myNonExistent").equalTo("nested.myInt");
  }
View Full Code Here

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

    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("nested.myNonExistent").equalTo("nested.myInt");
  }
 
View Full Code Here

 
  @Test
  public void testCoGroupKeySelectors1() {
   
    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    DataSet<CustomType> ds1 = env.fromCollection(customTypeData);
    DataSet<CustomType> ds2 = env.fromCollection(customTypeData);

    // should work
    try {
      ds1.coGroup(ds2)
View Full Code Here

  @Test
  public void testCoGroupKeySelectors1() {
   
    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    DataSet<CustomType> ds1 = env.fromCollection(customTypeData);
    DataSet<CustomType> ds2 = env.fromCollection(customTypeData);

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

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

    // should work
    try {
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.