ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
```scala package com.gosuncn import org.apache.flink.api.scala._ object WordCountBatchJob { def main(args: Array[String]) { val env = ExecutionEnvironment.getExecutionEnvironment val lines: DataSet[String] = env.readTextFile("C:\\Users\\root\\Desktop\\data.txt") lines.flatMap(_.split(" ")).map((_, 1)).groupBy(0).sum(1).writeAsText("C:\\Users\\root\\Desktop\\out").setParallelism(2) env.execute("WordCountBatchJob") } } ```