Beam 中的 SortValues 转换 Java SDK 扩展是否只能在 hadoop 环境中运行? [英] Does SortValues transform Java SDK extension in Beam only run in hadoop environment?

查看:29
本文介绍了Beam 中的 SortValues 转换 Java SDK 扩展是否只能在 hadoop 环境中运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试使用 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.

  1. 添加 hadoop-common 2.7.3 或更高版本
  2. 添加 hadoop-mapreduce-client-core 2.7.3 或更高版本.
  1. add hadoop-common version 2.7.3 or later
  2. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆