从 impala-shell 内将查询内容输出到文件

发布于 2025-01-13 23:22:53 字数 204 浏览 3 评论 0原文

我试图从 Hive 表中提取一些信息,当我在 impala-shell 中运行 describe db.tablename 语句时,我看到输出约为 2000 行。

如何在不退出交互模式的情况下将此信息提取到本地文件中?我只能在启动 impala-shell 时通过传递 -o 参数来找到执行此操作的参考

I am trying to extract some information from a Hive table and when I run a describe db.tablename statement within impala-shell, I see that the output is ~2000 lines.

How can I extract this information into a local file without exiting the interactive mode? I could only find references to do it by passing the -o parameter when launching impala-shell

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

国产ˉ祖宗 2025-01-20 23:22:53

我在文档中找不到对此的引用,但这可行 -

impala-shell 中我们可以这样做

set output_file=blah.csv;
select * from dbname.table_name limit 1000;
unset output_file;

I couldn't find a reference to this in the docs, but this works -

within impala-shell we can do

set output_file=blah.csv;
select * from dbname.table_name limit 1000;
unset output_file;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文