本文整理了Java中org.apache.flink.api.java.operators.GroupReduceOperator.collect()
方法的一些代码示例,展示了GroupReduceOperator.collect()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GroupReduceOperator.collect()
方法的具体详情如下:
包路径:org.apache.flink.api.java.operators.GroupReduceOperator
类名称:GroupReduceOperator
方法名:collect
暂无
代码示例来源:origin: apache/flink
@Test
public void testReduceOnNonKeyedDataset() throws Exception {
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
env.setParallelism(4);
// creates the input data and distributes them evenly among the available downstream tasks
DataSet<Tuple2<Integer, Boolean>> input = createNonKeyedInput(env);
List<Tuple2<Integer, Boolean>> actual = input.reduceGroup(new NonKeyedCombReducer()).collect();
String expected = "10,true\n";
compareResultAsTuples(actual, expected);
}
代码示例来源:origin: apache/flink
@Test
public void testReduceOnKeyedDataset() throws Exception {
// set up the execution environment
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
env.setParallelism(4);
// creates the input data and distributes them evenly among the available downstream tasks
DataSet<Tuple3<String, Integer, Boolean>> input = createKeyedInput(env);
List<Tuple3<String, Integer, Boolean>> actual = input.groupBy(0).reduceGroup(new KeyedCombReducer()).collect();
String expected = "k1,6,true\nk2,4,true\n";
compareResultAsTuples(actual, expected);
}
代码示例来源:origin: apache/flink
@Test
public void testReduceOnKeyedDatasetWithSelector() throws Exception {
// set up the execution environment
final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
env.setParallelism(4);
// creates the input data and distributes them evenly among the available downstream tasks
DataSet<Tuple3<String, Integer, Boolean>> input = createKeyedInput(env);
List<Tuple3<String, Integer, Boolean>> actual = input
.groupBy(new KeySelectorX())
.reduceGroup(new KeyedCombReducer())
.collect();
String expected = "k1,6,true\nk2,4,true\n";
compareResultAsTuples(actual, expected);
}
代码示例来源:origin: amidst/toolbox
.filter(line -> line.startsWith("@relation"))
.first(1)
.collect();
}catch (Exception ex){
throw new UndeclaredThrowableException(ex);
内容来源于网络,如有侵权,请联系作者删除!