use of org.apache.flink.api.java.operators.UnsortedGrouping in project flink by apache.
the class MaxByOperatorTest method testMaxByRowTypeInfoKeyFieldsForUnsortedGrouping.
/**
* Validates that no ClassCastException happens should not fail e.g. like in FLINK-8255.
*/
@Test(expected = InvalidProgramException.class)
public void testMaxByRowTypeInfoKeyFieldsForUnsortedGrouping() {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
TypeInformation[] types = new TypeInformation[] { Types.INT, Types.INT };
String[] fieldNames = new String[] { "id", "value" };
RowTypeInfo rowTypeInfo = new RowTypeInfo(types, fieldNames);
UnsortedGrouping groupDs = env.fromCollection(Collections.singleton(new Row(2)), rowTypeInfo).groupBy(0);
groupDs.maxBy(1);
}
use of org.apache.flink.api.java.operators.UnsortedGrouping in project flink by apache.
the class MinByOperatorTest method testMinByRowTypeInfoKeyFieldsForUnsortedGrouping.
/**
* Validates that no ClassCastException happens should not fail e.g. like in FLINK-8255.
*/
@Test(expected = InvalidProgramException.class)
public void testMinByRowTypeInfoKeyFieldsForUnsortedGrouping() {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
TypeInformation[] types = new TypeInformation[] { Types.INT, Types.INT };
String[] fieldNames = new String[] { "id", "value" };
RowTypeInfo rowTypeInfo = new RowTypeInfo(types, fieldNames);
UnsortedGrouping groupDs = env.fromCollection(Collections.singleton(new Row(2)), rowTypeInfo).groupBy(0);
groupDs.minBy(1);
}
Aggregations