use of org.apache.flink.api.java.ExecutionEnvironment in project flink by apache.
the class MaxByOperatorTest method testOutOfTupleBoundsDataset3.
/**
* This test validates that an index which is out of bounds throws an
* IndexOutOfBOundsExcpetion.
*/
@Test(expected = IndexOutOfBoundsException.class)
public void testOutOfTupleBoundsDataset3() {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
DataSet<Tuple5<Integer, Long, String, Long, Integer>> tupleDs = env.fromCollection(emptyTupleData, tupleTypeInfo);
// should not work, key out of tuple bounds
tupleDs.maxBy(1, 2, 3, 4, -1);
}
use of org.apache.flink.api.java.ExecutionEnvironment in project flink by apache.
the class DataSinkTest method testFailPrimitiveOrder1.
@Test(expected = InvalidProgramException.class)
public void testFailPrimitiveOrder1() {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
DataSet<Long> longDs = env.generateSequence(0, 2);
// must not work
longDs.writeAsText("/tmp/willNotHappen").sortLocalOutput(0, Order.ASCENDING);
}
use of org.apache.flink.api.java.ExecutionEnvironment in project flink by apache.
the class DataSinkTest method testTupleTwoOrderIdx.
@Test
public void testTupleTwoOrderIdx() {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
DataSet<Tuple5<Integer, Long, String, Long, Integer>> tupleDs = env.fromCollection(emptyTupleData, tupleTypeInfo);
// should work
try {
tupleDs.writeAsText("/tmp/willNotHappen").sortLocalOutput(0, Order.ASCENDING).sortLocalOutput(3, Order.DESCENDING);
} catch (Exception e) {
Assert.fail();
}
}
use of org.apache.flink.api.java.ExecutionEnvironment in project flink by apache.
the class DataSinkTest method testTupleTwoOrderExp.
@Test
public void testTupleTwoOrderExp() {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
DataSet<Tuple5<Integer, Long, String, Long, Integer>> tupleDs = env.fromCollection(emptyTupleData, tupleTypeInfo);
// should work
try {
tupleDs.writeAsText("/tmp/willNotHappen").sortLocalOutput("f1", Order.ASCENDING).sortLocalOutput("f4", Order.DESCENDING);
} catch (Exception e) {
Assert.fail();
}
}
use of org.apache.flink.api.java.ExecutionEnvironment in project flink by apache.
the class DataSinkTest method testFailPojoIdx.
@Test(expected = InvalidProgramException.class)
public void testFailPojoIdx() {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
DataSet<CustomType> pojoDs = env.fromCollection(pojoData);
// must not work
pojoDs.writeAsText("/tmp/willNotHappen").sortLocalOutput(1, Order.DESCENDING);
}
Aggregations