当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
typescript61-泛型工具类型(pick)
Redis进阶
2022杭电多校六 1006-Maex (树形DP)
基于KECA-IGWO-KELM的间歇过程故障诊断方法
【动态类型检测 Objective-C】
UDP广播
Kioxia and Aerospike Collaborate to Improve Database Application Performance
工作3年,回想刚入门和现在的今昔对比,笑谈一下自己的测试生涯
【instancetype类型 Objective-C】
Flink学习10:使用idea编写WordCount,并打包运行
DevExpress中针对指定列进行百分比转换
怎么样避免线上内存泄漏
1、Citrix XenDesktop 2203之AD域系统安装(一)
typescript59-泛型工具类型(partial )
Task flow scheduling tool AirFlow,, 220804,,
LaTeX Notes
Technical Analysis Patterns (11) How to Trade Head and Shoulders Patterns
GAN generates anime avatar Pytorch
Redis
Rapid Medical超小体积且唯一可调的取栓器获得FDA核准









