当前位置:网站首页>Flink Learning 10: Use idea to write WordCount and package and run
Flink Learning 10: Use idea to write WordCount and package and run
2022-08-05 07:11:00 【hzp666】
1. Write a program
5 steps
import org.apache.flink.api.scala._object flinkTest {def main(args: Array[String]): Unit = {//first: build envval env = ExecutionEnvironment.getExecutionEnvironment//second: create datasourceval text: DataSet[String] = env.fromElements("hello,dog","hell0,cat","hello,dog")//third: transferval counts = text.flatMap(_.toLowerCase.split(",")).map((_, 1)).groupBy(0).sum(1)//Fourth: printcounts.print()}}}}
Output result:
2. Compile and package
Click maven on the right, then double-click the package, you can
After the introduction, you can see the jar package in the target on the left
3. Submit the cluster for execution
--class specifies the name of the class, space specifies the name of the jar package
边栏推荐
猜你喜欢
随机推荐
专用机终端安装软件后报IP冲突
Task flow scheduling tool AirFlow,, 220804,,
typescript63-索引签名类型
《PyTorch深度学习实践》第十课(卷积神经网络CNN)
今天虚竹哥又发现了一款好用的国产化API工具
Mysql为什么 建立数据库失败
开源中国活动合作说明书
Rapid Medical超小体积且唯一可调的取栓器获得FDA核准
re正则表达式
typescript68-索引查询类型(查询多个)
The NDK compiler so libraries
Day9 of Hegong Daqiong team vision team training - camera calibration
Flink学习10:使用idea编写WordCount,并打包运行
Technical Analysis Patterns (11) How to Trade Head and Shoulders Patterns
2022熔化焊接与热切割操作证考试题及模拟考试
Flink Learning 12: DataStreaming API
After the firewall iptable rule is enabled, the system network becomes slow
17-VMware Horizon 2203 virtual desktop-Win10 manual desktop pool floating (seventeen)
Shiny04---DT和进度条在shiny中的应用
Flink Learning 11: Flink Program Parallelism