【问题标题】:Execution of Hive Query in a Shell Action in Oozie在 Oozie 的 Shell 操作中执行 Hive 查询
【发布时间】:2016-09-22 11:15:29
【问题描述】:

是否可以在 Oozie 的 shell 脚本操作中执行配置单元查询(返回值并在脚本中使用的查询)。使用 hive -e 选项执行 hive 查询。工作流中需要做哪些配置,如果可以的话?

谢谢..

【问题讨论】:

  • 您可以在 shell 脚本中运行 Hive 查询。只需使用oozie.action.sharelib.for.shell=hive 添加配置单元库路径。
  • 别忘了发送hive-site.xml 配置和<file> 指令...

标签: shell hive oozie


【解决方案1】:

您的 shell 操作配置可能如下所示:

  <action name="someaction">
    <shell xmlns="uri:oozie:shell-action:0.2">
      <job-tracker>${jobTracker}</job-tracker>
      <name-node>${nameNode}</name-node>
      <exec>somescript.sh</exec>
      <env-var>SOME_VARIABLE=1</env-var>
      <file>${someactionScriptPathName}#somescript.sh</file>
      <capture-output/>
    </shell>
    <ok to="nextaction"/>
    <error to="Kill"/>
  </action>

您的 hive 命令现在可以在 somescript.sh 脚本中。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多