动态计算oozie参数(MR动作减速器的数量) [英] Dynamically calculating oozie parameter (number of reducers for MR action)

查看:225
本文介绍了动态计算oozie参数(MR动作减速器的数量)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的oozie工作流程中,我动态地创建一个配置表格,比如说T1。这个配置单元动作之后是一个map-reduce动作。我想设置reducers属性的数量(mapred.reduce.tasks)等于字段say(T1.group)的不同值。任何想法如何动态设置一些oozie参数的值,以及如何从配置单元不同的操作中获取参数的值到oozie参数?

In my oozie workflow I dynamically create a hive table, say T1. This hive action is then followed by a map-reduce action. I want to set number of reducers property (mapred.reduce.tasks) equal to distinct values of a field say (T1.group). Any ideas how to set value of some oozie parameter dynamically and how to get value of the parameter from hive distinct action to oozie parameter?

推荐答案

我希望这可以帮助:

I hope this can help:


  1. 创建配置单元表,就像您已经在做的一样。

  2. 执行另一个Hive查询,该查询计算列的不同值并将其写入hdfs中的文件。
  3. 创建 Shell 操作,它将读取文件并以 key = value 的形式回显该值。为shell操作启用捕获输出

  4. 这是您的MR操作。现在使用Oozie EL功能访问操作数据。例如 $ {wf:actionData('ShellAction')['key']} ,将此值传递给 mapred.reduce.tasks 在MR操作的配置标记中。

  1. Create the hive table as you are doing already.
  2. Execute another Hive query which calculates the distinct values for the column and writes it to a file in hdfs.
  3. Create an Shell action, which will read the file and echo the value in the form of key=value. Enable the capture-output for the shell action.
  4. This is your MR action. Now access the action data using the Oozie EL functions. e.g. ${wf:actionData('ShellAction')['key']}, pass this value to the mapred.reduce.tasks in the configuration tag of the MR action.

这篇关于动态计算oozie参数(MR动作减速器的数量)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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