Java Code Examples for org.apache.flink.api.java.DataSet#partitionByRange()

The following examples show how to use org.apache.flink.api.java.DataSet#partitionByRange() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PartitionOperatorTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Test
public void testRangePartitionByField1() throws Exception {
	final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

	final DataSet<Tuple2<Integer, String>> ds = getTupleDataSet(env);
	ds.partitionByRange(0);
}
 
Example 2
Source File: PartitionOperatorTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Test(expected = IndexOutOfBoundsException.class)
public void testRangePartitionByFieldOutOfRange() throws Exception {
	final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

	final DataSet<Tuple2<Integer, String>> ds = getTupleDataSet(env);
	ds.partitionByRange(0, 1, 2);
}
 
Example 3
Source File: PartitionOperatorTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Test
public void testRangePartitionByField2() throws Exception {
	final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

	final DataSet<Tuple2<Integer, String>> ds = getTupleDataSet(env);
	ds.partitionByRange(0, 1);
}
 
Example 4
Source File: PartitionOperatorTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Test
public void testRangePartitionByField1() throws Exception {
	final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

	final DataSet<Tuple2<Integer, String>> ds = getTupleDataSet(env);
	ds.partitionByRange(0);
}
 
Example 5
Source File: PartitionOperatorTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Test(expected = IllegalArgumentException.class)
public void testRangePartitionByInvalidFieldName() throws Exception {
	final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

	final DataSet<CustomPojo> ds = getPojoDataSet(env);
	ds.partitionByRange("number", "name", "invalidField");
}
 
Example 6
Source File: PartitionOperatorTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Test
public void testRangePartitionByFieldName2() throws Exception {
	final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

	final DataSet<CustomPojo> ds = getPojoDataSet(env);
	ds.partitionByRange("number", "name");
}
 
Example 7
Source File: PartitionOperatorTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Test
public void testRangePartitionByFieldName1() throws Exception {
	final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

	final DataSet<CustomPojo> ds = getPojoDataSet(env);
	ds.partitionByRange("number");
}
 
Example 8
Source File: PartitionOperatorTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Test(expected = IndexOutOfBoundsException.class)
public void testRangePartitionByFieldOutOfRange() throws Exception {
	final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

	final DataSet<Tuple2<Integer, String>> ds = getTupleDataSet(env);
	ds.partitionByRange(0, 1, 2);
}
 
Example 9
Source File: PartitionOperatorTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Test
public void testRangePartitionByField2() throws Exception {
	final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

	final DataSet<Tuple2<Integer, String>> ds = getTupleDataSet(env);
	ds.partitionByRange(0, 1);
}
 
Example 10
Source File: PartitionOperatorTest.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Test
public void testRangePartitionByFieldName1() throws Exception {
	final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

	final DataSet<CustomPojo> ds = getPojoDataSet(env);
	ds.partitionByRange("number");
}
 
Example 11
Source File: PartitionOperatorTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Test(expected = IllegalArgumentException.class)
public void testRangePartitionByInvalidFieldName() throws Exception {
	final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

	final DataSet<CustomPojo> ds = getPojoDataSet(env);
	ds.partitionByRange("number", "name", "invalidField");
}
 
Example 12
Source File: PartitionOperatorTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Test
public void testRangePartitionByFieldName2() throws Exception {
	final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

	final DataSet<CustomPojo> ds = getPojoDataSet(env);
	ds.partitionByRange("number", "name");
}
 
Example 13
Source File: PartitionOperatorTest.java    From flink with Apache License 2.0 5 votes vote down vote up
@Test
public void testRangePartitionByFieldName1() throws Exception {
	final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

	final DataSet<CustomPojo> ds = getPojoDataSet(env);
	ds.partitionByRange("number");
}
 
Example 14
Source File: PartitionOperatorTest.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Test(expected = IndexOutOfBoundsException.class)
public void testRangePartitionByFieldOutOfRange() throws Exception {
	final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

	final DataSet<Tuple2<Integer, String>> ds = getTupleDataSet(env);
	ds.partitionByRange(0, 1, 2);
}
 
Example 15
Source File: PartitionOperatorTest.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Test
public void testRangePartitionByField2() throws Exception {
	final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

	final DataSet<Tuple2<Integer, String>> ds = getTupleDataSet(env);
	ds.partitionByRange(0, 1);
}
 
Example 16
Source File: PartitionOperatorTest.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Test
public void testRangePartitionByField1() throws Exception {
	final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

	final DataSet<Tuple2<Integer, String>> ds = getTupleDataSet(env);
	ds.partitionByRange(0);
}
 
Example 17
Source File: PartitionOperatorTest.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Test(expected = IllegalArgumentException.class)
public void testRangePartitionByInvalidFieldName() throws Exception {
	final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

	final DataSet<CustomPojo> ds = getPojoDataSet(env);
	ds.partitionByRange("number", "name", "invalidField");
}
 
Example 18
Source File: PartitionOperatorTest.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
@Test
public void testRangePartitionByFieldName2() throws Exception {
	final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

	final DataSet<CustomPojo> ds = getPojoDataSet(env);
	ds.partitionByRange("number", "name");
}