use of org.apache.flink.api.java.operator.JoinOperatorTest.CustomType in project flink by apache.
the class CoGroupOperatorTest method testCoGroupKeyExpressions4.
@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");
}
use of org.apache.flink.api.java.operator.JoinOperatorTest.CustomType in project flink by apache.
the class CoGroupOperatorTest method testCoGroupKeyMixing3.
@Test(expected = InvalidProgramException.class)
public void testCoGroupKeyMixing3() {
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, incompatible types
ds1.coGroup(ds2).where(2).equalTo(new KeySelector<CustomType, Long>() {
@Override
public Long getKey(CustomType value) {
return value.myLong;
}
});
}
use of org.apache.flink.api.java.operator.JoinOperatorTest.CustomType in project flink by apache.
the class CoGroupOperatorTest method testCoGroupKeyExpressions3Nested.
@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");
}
use of org.apache.flink.api.java.operator.JoinOperatorTest.CustomType in project flink by apache.
the class CoGroupOperatorTest method testCoGroupKeyExpressions4Nested.
@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");
}
use of org.apache.flink.api.java.operator.JoinOperatorTest.CustomType in project flink by apache.
the class CoGroupOperatorTest method testCoGroupKeyAtomicExpression2.
@Test
public void testCoGroupKeyAtomicExpression2() {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
DataSet<Integer> ds1 = env.fromElements(0, 0, 1);
DataSet<CustomType> ds2 = env.fromCollection(customTypeData);
ds1.coGroup(ds2).where("*").equalTo("myInt");
}
Aggregations