Search in sources :

Example 26 with Tuple4

use of org.apache.flink.api.java.tuple.Tuple4 in project flink by apache.

the class GroupingTest method testGroupSortKeyFields5.

@Test(expected = InvalidProgramException.class)
public void testGroupSortKeyFields5() {
    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    DataSet<Tuple4<Integer, Long, CustomType, Long[]>> tupleDs = env.fromCollection(tupleWithCustomData, tupleWithCustomInfo);
    // should not work
    tupleDs.groupBy(0).sortGroup(3, Order.ASCENDING);
}
Also used : Tuple4(org.apache.flink.api.java.tuple.Tuple4) ExecutionEnvironment(org.apache.flink.api.java.ExecutionEnvironment) Test(org.junit.Test)

Example 27 with Tuple4

use of org.apache.flink.api.java.tuple.Tuple4 in project flink by apache.

the class GroupingTest method testGroupSortByKeyExpression5.

@Test(expected = InvalidProgramException.class)
public void testGroupSortByKeyExpression5() {
    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    DataSet<Tuple4<Integer, Long, CustomType, Long[]>> tupleDs = env.fromCollection(tupleWithCustomData, tupleWithCustomInfo);
    // should not work
    tupleDs.groupBy("f0").sortGroup("f1", Order.ASCENDING).sortGroup("f2", Order.ASCENDING);
}
Also used : Tuple4(org.apache.flink.api.java.tuple.Tuple4) ExecutionEnvironment(org.apache.flink.api.java.ExecutionEnvironment) Test(org.junit.Test)

Example 28 with Tuple4

use of org.apache.flink.api.java.tuple.Tuple4 in project flink by apache.

the class GroupingTest method testGroupSortByKeySelector3.

@SuppressWarnings("serial")
@Test(expected = InvalidProgramException.class)
public void testGroupSortByKeySelector3() {
    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    DataSet<Tuple4<Integer, Long, CustomType, Long[]>> tupleDs = env.fromCollection(tupleWithCustomData, tupleWithCustomInfo);
    // should not work
    tupleDs.groupBy(new KeySelector<Tuple4<Integer, Long, CustomType, Long[]>, Long>() {

        @Override
        public Long getKey(Tuple4<Integer, Long, CustomType, Long[]> value) throws Exception {
            return value.f1;
        }
    }).sortGroup(new KeySelector<Tuple4<Integer, Long, CustomType, Long[]>, Long[]>() {

        @Override
        public Long[] getKey(Tuple4<Integer, Long, CustomType, Long[]> value) throws Exception {
            return value.f3;
        }
    }, Order.ASCENDING);
}
Also used : Tuple4(org.apache.flink.api.java.tuple.Tuple4) ExecutionEnvironment(org.apache.flink.api.java.ExecutionEnvironment) KeySelector(org.apache.flink.api.java.functions.KeySelector) InvalidProgramException(org.apache.flink.api.common.InvalidProgramException) Test(org.junit.Test)

Example 29 with Tuple4

use of org.apache.flink.api.java.tuple.Tuple4 in project flink by apache.

the class GroupingTest method testGroupSortByKeyExpression4.

@Test(expected = InvalidProgramException.class)
public void testGroupSortByKeyExpression4() {
    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    DataSet<Tuple4<Integer, Long, CustomType, Long[]>> tupleDs = env.fromCollection(tupleWithCustomData, tupleWithCustomInfo);
    // should not work
    tupleDs.groupBy("f0").sortGroup("f2", Order.ASCENDING);
}
Also used : Tuple4(org.apache.flink.api.java.tuple.Tuple4) ExecutionEnvironment(org.apache.flink.api.java.ExecutionEnvironment) Test(org.junit.Test)

Example 30 with Tuple4

use of org.apache.flink.api.java.tuple.Tuple4 in project flink by apache.

the class GroupingTest method testGroupSortKeyFields4.

@Test(expected = InvalidProgramException.class)
public void testGroupSortKeyFields4() {
    final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
    DataSet<Tuple4<Integer, Long, CustomType, Long[]>> tupleDs = env.fromCollection(tupleWithCustomData, tupleWithCustomInfo);
    // should not work
    tupleDs.groupBy(0).sortGroup(2, Order.ASCENDING);
}
Also used : Tuple4(org.apache.flink.api.java.tuple.Tuple4) ExecutionEnvironment(org.apache.flink.api.java.ExecutionEnvironment) Test(org.junit.Test)

Aggregations

Tuple4 (org.apache.flink.api.java.tuple.Tuple4)43 Test (org.junit.Test)34 ExecutionEnvironment (org.apache.flink.api.java.ExecutionEnvironment)27 Tuple2 (org.apache.flink.api.java.tuple.Tuple2)15 InvalidProgramException (org.apache.flink.api.common.InvalidProgramException)12 StreamExecutionEnvironment (org.apache.flink.streaming.api.environment.StreamExecutionEnvironment)11 Configuration (org.apache.flink.configuration.Configuration)10 TimeWindow (org.apache.flink.streaming.api.windowing.windows.TimeWindow)10 SuccessException (org.apache.flink.test.util.SuccessException)10 IOException (java.io.IOException)6 Tuple (org.apache.flink.api.java.tuple.Tuple)5 KeySelector (org.apache.flink.api.java.functions.KeySelector)4 ArrayList (java.util.ArrayList)3 Tuple3 (org.apache.flink.api.java.tuple.Tuple3)3 Plan (org.apache.flink.api.common.Plan)2 Tuple5 (org.apache.flink.api.java.tuple.Tuple5)2 Tuple6 (org.apache.flink.api.java.tuple.Tuple6)2 ParameterTool (org.apache.flink.api.java.utils.ParameterTool)2 Path (org.apache.flink.core.fs.Path)2 KvStateSnapshot (org.apache.flink.migration.runtime.state.KvStateSnapshot)2