赞
踩
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);
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。