当前位置:网站首页>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
边栏推荐
- Hash 这些知识你也应该知道
- 1, Citrix XenDesktop 2203 AD domain system installation (1)
- mysql使用in函数的一个小问题
- Flink学习10:使用idea编写WordCount,并打包运行
- 【Go】IM系统Centrifugo
- (JLK105D)中山爆款LED恒流电源芯片方案
- 在STM32中使用printf函数
- PCI Pharma Services宣布斥资数百万美元扩建英国制造设施,以满足市场对支持肿瘤治疗的全球高效药制造服务日益增长的需求
- Shared memory + inotify mechanism to achieve multi-process low-latency data sharing
- 2022熔化焊接与热切割操作证考试题及模拟考试
猜你喜欢
随机推荐
算法拾遗十五补链表相关面试题
工作3年,回想刚入门和现在的今昔对比,笑谈一下自己的测试生涯
HR:这样的简历我只看了5秒就扔了,软件测试简历模板想要的进。
UDP broadcast
Rapid Medical's Ultra-Small and Only Adjustable Thromb Retriever Receives FDA Clearance
Technical Analysis Patterns (11) How to Trade Head and Shoulders Patterns
MySQL:连接查询 | 内连接,外连接
LabVIEW中如何实现任意形状的不规则按键
访问被拒绝:“microsoft.web.ui.webcontrols”的解决办法
Day9 of Hegong Daqiong team vision team training - camera calibration
一天学会从抓包到接口测试,通过智慧物业项目深度解析
DNSlog外带数据注入
Week 8 Document Clustering(文本聚类)
浮点数基础知识
MySQL:JDBC编程
C# FileSystemWatcher
UDP group (multi)cast
腾讯业务安全岗 IDP 谈话总结
UDP广播
Mysql为什么 建立数据库失败