当前位置:网站首页>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
边栏推荐
- Shiny04---Application of DT and progress bar in shiny
- 2022 Fusion Welding and Thermal Cutting Operation Certificate Exam Questions and Mock Exams
- 【Go】IM系统Centrifugo
- 2022杭电多校六 1006-Maex (树形DP)
- Flink Learning 12: DataStreaming API
- 基于快速行进平方法的水面无人船路径规划
- 2022 crane driver (limited bridge crane) exam question bank and simulation test
- 开源中国活动合作说明书
- 腾讯实习总结
- 【LeetCode】235.二叉搜索树的最近公共祖先
猜你喜欢

RNote108---Display the running progress of the R program

typescript63-索引签名类型

概率与期望部分题解

MySQL:连接查询 | 内连接,外连接

合工大苍穹战队视觉组培训Day9——相机标定

Source code analysis of Nacos configuration service (full)

MySQL: JDBC programming

Flink Learning 11: Flink Program Parallelism

IO process thread -> communication between processes -> day7

软件测试必问面试题(附答案和解析)
随机推荐
工作3年,回想刚入门和现在的今昔对比,笑谈一下自己的测试生涯
typescript61-泛型工具类型(pick)
女生做软件测试会不会成为一个趋势?
It turns out that Maya Arnold can also render high-quality works!Awesome Tips
TCP的粘包拆包问题+解决方案
Promise (三) async/await
17-VMware Horizon 2203 虚拟桌面-Win10 手动桌面池浮动(十七)
typescript63-索引签名类型
Nacos cluster construction
Mysql为什么 建立数据库失败
(2022杭电多校六)1012-Loop(单调栈+思维)
在anaconda Promat界面import torch通过,在jupyter notebook中报错的问题(仅提供思路理解!)
MySQL:JDBC编程
MySQL:基础部分
Rapid Medical超小体积且唯一可调的取栓器获得FDA核准
typescript67-索引查询类型
Advanced Redis
MySQL:连接查询 | 内连接,外连接
【JVM调优】Xms和Xmx为什么要保持一致
ndk编译so库