【问题标题】:Saving hive output through oozie using ">"使用“>”通过 oozie 保存 hive 输出
【发布时间】:2015-06-26 14:00:50
【问题描述】:

在 oozie 中是否可能发生这样的事情?

hive -f hiveScript.hql > output.txt

对于上述代码,我有以下 oozie hive 操作,如下所示:

    <hive xmlns="uri:oozie:hive-action:0.1">
                <job-tracker>${jobTracker}</job-tracker>
                <name-node>${nameNode}</name-node>
                <configuration>
                    <property>
                        <name>mapred.job.queue.name</name>
                        <value>${queueName}</value>
                    </property>
                </configuration>        
               <script>hiveScript.hql</script>  
            </hive>
            <ok to="end" />
            <error to="kill" /> 
    </hive>

如何告诉脚本输出应该去哪里?

【问题讨论】:

    标签: hive oozie oozie-coordinator


    【解决方案1】:

    Oozie 无法以您想要的方式实现。这是因为 Oozie 在集群内的节点上启动(大部分)它的工作流操作。

    有了这个,你可以运行 Oozie Shell 操作来运行 hive -f hiveScript.hql &gt; output.txt... 但是这有不同的含义,要求 Hive 安装在任何地方,你的 hiveScript.hql 无处不在,等等。另一种方式并不完全工作是您的输出文件将位于分配给运行此 shell 操作的任何节点上。 https://oozie.apache.org/docs/3.3.0/DG_ShellActionExtension.html

    我认为您最好将INSERT OVERWRITE DIRECTORY '/tmp/hdfs_out' SELECT * FROM ... 包含在您的 hiveScript.hql 文件中,然后从 HDFS 中提取结果。

    编辑: 我刚刚想到的另一个选择是使用 SSH 操作。 https://oozie.apache.org/docs/3.2.0-incubating/DG_SshActionExtension.html 你可能有 SSH Action shell 到你的目标机器并运行 hive -f hiveScript.hql &gt; output.txt

    【讨论】:

      猜你喜欢
      • 2013-04-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多