当前位置:   article > 正文

flink的dataset api常用import语句汇总(持续更新)_flink crossfunction

flink crossfunction

import java.util.Set;
import java.util.HashSet;
import org.apache.flink.util.Collector;
import org.apache.flink.api.java.DataSet;
import org.apache.flink.api.java.tuple.Tuple1;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.api.java.tuple.Tuple3;
import org.apache.flink.api.java.tuple.Tuple5;
import org.apache.flink.api.common.operators.Order;
import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.api.java.operators.DataSource;
import org.apache.flink.api.java.functions.KeySelector;
import org.apache.flink.api.common.functions.JoinFunction;
import org.apache.flink.api.common.functions.FlatJoinFunction;
import org.apache.flink.api.common.functions.MapFunction;
import org.apache.flink.api.common.functions.FilterFunction;
import org.apache.flink.api.common.functions.ReduceFunction;
import org.apache.flink.api.common.functions.FlatMapFunction;
import org.apache.flink.api.common.functions.GroupReduceFunction;
import org.apache.flink.api.common.functions.CrossFunction;
import org.apache.flink.api.common.functions.GroupCombineFunction;
import org.apache.flink.api.common.functions.MapPartitionFunction;
import static org.apache.flink.api.java.aggregation.Aggregations.MIN;
import static org.apache.flink.api.java.aggregation.Aggregations.SUM;
import static java.lang.Math.sqrt; 
import static java.lang.StrictMath.pow;
import org.apache.flink.api.common.functions.CoGroupFunction;
import java.util.HashSet;
import java.util.Set;
 

常用数据读取方式
ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
String rootPath = System.getProperty("user.dir");
DataSet<Tuple2<Integer, String>> input =env.readCsvFile("file://"+rootPath+"/"+"group.csv").types(Integer.class, String.class);
 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/524875
推荐阅读
相关标签
  

闽ICP备14008679号