Package org.apache.flink.api.java

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.maxBy(0);
  }
 
  /**
 
View Full Code Here


   */
  @Test(expected = IndexOutOfBoundsException.class)
  public void testOutOfTupleBoundsDataset1() {

    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.maxBy(5);
  }
 
View Full Code Here

   */
  @Test(expected = IndexOutOfBoundsException.class)
  public void testOutOfTupleBoundsDataset2() {

    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.maxBy(-1);
  }
 
View Full Code Here

   */
  @Test(expected = IndexOutOfBoundsException.class)
  public void testOutOfTupleBoundsDataset3() {

    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.maxBy(1,2,3,4,-1);
  }
 
View Full Code Here

   */
  @Test
  public void testMaxByKeyFieldsGrouping() {

    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    UnsortedGrouping<Tuple5<Integer, Long, String, Long, Integer>> groupDs = env.fromCollection(emptyTupleData, tupleTypeInfo).groupBy(0);

    // should work
    try {
      groupDs.maxBy(4, 0, 1, 2, 3);
    } catch (Exception e) {
View Full Code Here

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

   */
  @Test(expected = IndexOutOfBoundsException.class)
  public void testOutOfTupleBoundsGrouping1() {

    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    UnsortedGrouping<Tuple5<Integer, Long, String, Long, Integer>> groupDs = env.fromCollection(emptyTupleData, tupleTypeInfo).groupBy(0);

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

   */
  @Test(expected = IndexOutOfBoundsException.class)
  public void testOutOfTupleBoundsGrouping2() {

    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    UnsortedGrouping<Tuple5<Integer, Long, String, Long, Integer>> groupDs = env.fromCollection(emptyTupleData, tupleTypeInfo).groupBy(0);

    // should not work, key out of tuple bounds
    groupDs.maxBy(-1);
  }
 
View Full Code Here

   */
  @Test(expected = IndexOutOfBoundsException.class)
  public void testOutOfTupleBoundsGrouping3() {

    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    UnsortedGrouping<Tuple5<Integer, Long, String, Long, Integer>> groupDs = env.fromCollection(emptyTupleData, tupleTypeInfo).groupBy(0);

    // should not work, key out of tuple bounds
    groupDs.maxBy(1,2,3,4,-1);
  }

View Full Code Here

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

    // should work
    try {
      tupleDs.first(1);
    } catch(Exception e) {
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.