use of org.apache.flink.api.java.ExecutionEnvironment in project flink by apache.
the class CoGroupOperatorTest method testCoGroupKeyFields2.
@Test(expected = InvalidProgramException.class)
public void testCoGroupKeyFields2() {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
DataSet<Tuple5<Integer, Long, String, Long, Integer>> ds1 = env.fromCollection(emptyTupleData, tupleTypeInfo);
DataSet<Tuple5<Integer, Long, String, Long, Integer>> ds2 = env.fromCollection(emptyTupleData, tupleTypeInfo);
// should not work, incompatible cogroup key types
ds1.coGroup(ds2).where(0).equalTo(2);
}
use of org.apache.flink.api.java.ExecutionEnvironment in project flink by apache.
the class CoGroupOperatorTest method testCoGroupKeyFields3.
@Test(expected = InvalidProgramException.class)
public void testCoGroupKeyFields3() {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
DataSet<Tuple5<Integer, Long, String, Long, Integer>> ds1 = env.fromCollection(emptyTupleData, tupleTypeInfo);
DataSet<Tuple5<Integer, Long, String, Long, Integer>> ds2 = env.fromCollection(emptyTupleData, tupleTypeInfo);
// should not work, incompatible number of cogroup keys
ds1.coGroup(ds2).where(0, 1).equalTo(2);
}
use of org.apache.flink.api.java.ExecutionEnvironment in project flink by apache.
the class CrossOperatorTest method testCrossProjection23.
@Test
public void testCrossProjection23() {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
DataSet<Tuple5<Integer, Long, String, Long, Integer>> ds1 = env.fromCollection(emptyTupleData, tupleTypeInfo);
DataSet<Tuple5<Integer, Long, String, Long, Integer>> ds2 = env.fromCollection(emptyTupleData, tupleTypeInfo);
// should work
try {
ds1.cross(ds2).projectFirst(0).projectSecond(3);
} catch (Exception e) {
Assert.fail();
}
}
use of org.apache.flink.api.java.ExecutionEnvironment in project flink by apache.
the class CrossOperatorTest method testCrossProjection24.
@Test
public void testCrossProjection24() {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
DataSet<Tuple5<Integer, Long, String, Long, Integer>> ds1 = env.fromCollection(emptyTupleData, tupleTypeInfo);
DataSet<Tuple5<Integer, Long, String, Long, Integer>> ds2 = env.fromCollection(emptyTupleData, tupleTypeInfo);
// should work
try {
ds1.cross(ds2).projectFirst(0, 2).projectSecond(1, 4).projectFirst(1);
} catch (Exception e) {
Assert.fail();
}
}
use of org.apache.flink.api.java.ExecutionEnvironment in project flink by apache.
the class CrossOperatorTest method testCrossProjection3.
@Test
public void testCrossProjection3() {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
DataSet<Tuple5<Integer, Long, String, Long, Integer>> ds1 = env.fromCollection(emptyTupleData, tupleTypeInfo);
DataSet<Tuple5<Integer, Long, String, Long, Integer>> ds2 = env.fromCollection(emptyTupleData, tupleTypeInfo);
// should work
try {
ds1.cross(ds2).projectFirst(0).projectSecond(3);
} catch (Exception e) {
Assert.fail();
}
}
Aggregations