use of org.apache.flink.api.java.operator.JoinOperatorTest.CustomType in project flink by apache.
the class CoGroupOperatorTest method testCoGroupKeyExpressions1.
@Test
public void testCoGroupKeyExpressions1() {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
DataSet<CustomType> ds1 = env.fromCollection(customTypeData);
DataSet<CustomType> ds2 = env.fromCollection(customTypeData);
// should work
try {
ds1.coGroup(ds2).where("myInt").equalTo("myInt");
} catch (Exception e) {
Assert.fail();
}
}
use of org.apache.flink.api.java.operator.JoinOperatorTest.CustomType in project flink by apache.
the class CoGroupOperatorTest method testCoGroupKeyExpressions2Nested.
@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");
}
use of org.apache.flink.api.java.operator.JoinOperatorTest.CustomType in project flink by apache.
the class CoGroupOperatorTest method testCoGroupKeyExpressions2.
@Test(expected = InvalidProgramException.class)
public void testCoGroupKeyExpressions2() {
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("myInt").equalTo("myString");
}
use of org.apache.flink.api.java.operator.JoinOperatorTest.CustomType in project flink by apache.
the class CoGroupOperatorTest method testCoGroupKeyAtomicInvalidExpression1.
@Test(expected = InvalidProgramException.class)
public void testCoGroupKeyAtomicInvalidExpression1() {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
DataSet<Integer> ds1 = env.fromElements(0, 0, 1);
DataSet<CustomType> ds2 = env.fromCollection(customTypeData);
ds1.coGroup(ds2).where("*", "invalidKey");
}
use of org.apache.flink.api.java.operator.JoinOperatorTest.CustomType in project flink by apache.
the class CoGroupOperatorTest method testCoGroupKeyAtomicExpression1.
@Test
public void testCoGroupKeyAtomicExpression1() {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
DataSet<CustomType> ds1 = env.fromCollection(customTypeData);
DataSet<Integer> ds2 = env.fromElements(0, 0, 1);
ds1.coGroup(ds2).where("myInt").equalTo("*");
}
Aggregations