将配置单元脚本的结果导出到没有日志信息的文件中 [英] Exporting the results of a hive script to a file without the logging info

查看:52
本文介绍了将配置单元脚本的结果导出到没有日志信息的文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直将配置单元查询存储在hql文件中,通常使用以下命令来运行它们

I have been storing my hive queries in hql files and I usually run them using the following commands

$ nohup hive -i 'hivescript.hql' > results.tsv &

问题是当我取回结果时,文件通常以Hive的日志和警告开头.我想知道是否有任何命令行参数会抑制日志以仅显示结果?

The problem is when I get the results back the file usually starts with logs and warnings from Hive. I am wondering if there is any command line argument that suppresses the log to just give me the results?

推荐答案

可以将警告重新路由到另一个文件

It is possible to reroute the warnigns into another file

$ nohup hive -i 'hivescript.hql' 2> HiveLogs.txt 1>results.tsv &

这样,您将获得两个文件,一个仅包含结果,而另一个仅包含来自Hive的日志记录信息.

This way you would get two files, one with just the results and another with just the logging information from Hive.

这篇关于将配置单元脚本的结果导出到没有日志信息的文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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