当前位置:网站首页>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
边栏推荐
- Tencent Internship Summary
- 17-VMware Horizon 2203 虚拟桌面-Win10 手动桌面池浮动(十七)
- 2022起重机司机(限桥式起重机)考试题库及模拟考试
- 对数据类型而言运算符无效。运算符为 add,类型为 text。
- typescript68-索引查询类型(查询多个)
- Redis进阶
- Advanced Redis
- HR:这样的简历我只看了5秒就扔了,软件测试简历模板想要的进。
- AI + video technology helps to ensure campus security, how to build a campus intelligent security platform?
- Flink Learning 12: DataStreaming API
猜你喜欢
随机推荐
一天学会从抓包到接口测试,通过智慧物业项目深度解析
【JVM调优】Xms和Xmx为什么要保持一致
Mysql为什么 建立数据库失败
DNSlog外带数据注入
typescript64-映射类型
AI+视频技术助力保障校园安全,校园智能安防平台该如何建设?
typescript65-映射类型(keyof)
合工大苍穹战队视觉组培训Day9——相机标定
(4) Rotating object detection data roLabelImg to DOTA format
Promise (三) async/await
RK3568环境安装
香港国际珠宝展及香港国际钻石、宝石及珍珠展揭幕
golang-条件语句
任务流调度工具AirFlow,,220804,,
MAYA船的建模
17-VMware Horizon 2203 virtual desktop-Win10 manual desktop pool floating (seventeen)
基于快速行进平方法的水面无人船路径规划
Flink学习11:flink程序并行度
typescript60-泛型工具类型(readonly)
开启防火墙iptable规则后,系统网络变慢









