Beam 中的 SortValues 转换 Java SDK 扩展是否只能在 hadoop 环境中运行?

编程入门 行业动态 更新时间:2024-10-27 04:32:30
本文介绍了Beam 中的 SortValues 转换 Java SDK 扩展是否只能在 hadoop 环境中运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我已经尝试使用 SortValues 转换的示例代码DirectRunner 在本地机器 (Windows) 上

I have tried the example code of SortValues transform using DirectRunner on local machine (Windows)

PCollection<KV<String, KV<String, Integer>>> input = ...

PCollection<KV<String, Iterable<KV<String, Integer>>>> grouped =
input.apply(GroupByKey.<String, KV<String, Integer>>create());

PCollection<KV<String, Iterable<KV<String, Integer>>>> groupedAndSorted =
grouped.apply(SortValues.<String, String, Integer>create(BufferedExternalSorter.options()));

但我收到错误PipelineExecutionException: java.lang.NoClassDefFoundError: org/apache/hadoop/io/Writable.这是否意味着此转换功能仅适用于 Hadoop 环境?

but I got the error PipelineExecutionException: java.lang.NoClassDefFoundError: org/apache/hadoop/io/Writable. Does this mean this transform function only works in Hadoop environment?

推荐答案

截至今天,如果您使用 Beam 的发布版本低于 2.0.0,您将不得不在您的 maven pom 文件中为此 SortValues 模块添加两个 hadoop 依赖项工作.

As of today, if you use Beam with release version below 2.0.0, you will have to add two hadoop dependencies in your maven pom file for this SortValues module to work.

添加 hadoop-common 2.7.3 或更高版本添加 hadoop-mapreduce-client-core 2.7.3 或更高版本. add hadoop-common version 2.7.3 or later add hadoop-mapreduce-client-core version 2.7.3 or later.

否则,您只需要使用发布版本 >= 2.0.0 的 Beam.

Otherwise, you will just need to use Beam with release version >= 2.0.0.

这篇关于Beam 中的 SortValues 转换 Java SDK 扩展是否只能在 hadoop 环境中运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-19 23:51:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/972828.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:环境   只能在   SortValues   Beam   Java

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!