简体   繁体   English

在Oozie的Shell动作中执行Hive查询

[英]Execution of Hive Query in a Shell Action in Oozie

Is it possible to execute a hive query ( a query, that returns a value and it is used in the script) inside a shell script action in Oozie. 是否可以在Oozie的shell脚本操作中执行配置单元查询(查询,该查询返回一个值,该值在脚本中使用)。 The hive query is executed using hive -e option. 配置单元查询使用配置单元-e选项执行。 What configurations need to be made in the workflow, if it can be done ? 如果可以的话,需要在工作流程中进行哪些配置?

Thanks.. 谢谢..

Your shell action configuration could look like this: 您的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>

Your hive command can be now inside of the somescript.sh script. 您的hive命令现在可以在somescript.sh脚本中。

I am also facing the same challenge by doing some analysis i came to conclusion that Oozie shell action is not meant to execute the hive scripts or queries but still i would like to understand where to add the parameter(oozie.action.sharelib.for.shell=hive) given by @younghobbit https://stackoverflow.com/users/2254048/younghobbit . 通过做一些分析,我也面临着同样的挑战,我得出的结论是Oozie shell操作不是要执行配置单元脚本或查询,但我仍然想了解在何处添加参数(oozie.action.sharelib.for。 shell = hive)由@younghobbit https://stackoverflow.com/users/2254048/younghobbit给出。 Unfortunately the other comment and answer did not worked for me as its says the basic requirement by shell action. 不幸的是,其他注释和答案对我没有用,因为它说了shell操作的基本要求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM