use of org.apache.flink.api.java.ExecutionEnvironment in project flink by apache.
the class FullOuterJoinOperatorTest method testFullOuter3.
@Test
public void testFullOuter3() {
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
ds1.fullOuterJoin(ds2).where(new IntKeySelector()).equalTo(new IntKeySelector()).with(new DummyJoin());
}
use of org.apache.flink.api.java.ExecutionEnvironment in project flink by apache.
the class FullOuterJoinOperatorTest method testFullOuter6.
@Test
public void testFullOuter6() {
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
ds1.fullOuterJoin(ds2).where("f0").equalTo(4).with(new DummyJoin());
}
use of org.apache.flink.api.java.ExecutionEnvironment in project flink by apache.
the class GroupingTest method testGroupByKeyFieldsOnPrimitiveArray.
@Test
public void testGroupByKeyFieldsOnPrimitiveArray() {
this.byteArrayData.add(new Tuple2(new byte[] { 0 }, new byte[] { 1 }));
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
DataSet<Tuple2<byte[], byte[]>> tupleDs = env.fromCollection(byteArrayData);
tupleDs.groupBy(0);
}
use of org.apache.flink.api.java.ExecutionEnvironment in project flink by apache.
the class GroupingTest method testGroupSortByKeySelector2.
@SuppressWarnings("serial")
@Test(expected = InvalidProgramException.class)
public void testGroupSortByKeySelector2() {
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[]>, CustomType>() {
@Override
public CustomType getKey(Tuple4<Integer, Long, CustomType, Long[]> value) throws Exception {
return value.f2;
}
}, Order.ASCENDING);
}
use of org.apache.flink.api.java.ExecutionEnvironment in project flink by apache.
the class GroupingTest method testChainedGroupSortKeyFields.
@Test
public void testChainedGroupSortKeyFields() {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
DataSet<Tuple5<Integer, Long, String, Long, Integer>> tupleDs = env.fromCollection(emptyTupleData, tupleTypeInfo);
// should work
try {
tupleDs.groupBy(0).sortGroup(0, Order.ASCENDING).sortGroup(2, Order.DESCENDING);
} catch (Exception e) {
Assert.fail();
}
}
Aggregations