如何基于非 select 查询创建配置单元 table

how to create hive table based on non-select query

在我使用 impala 的工作中,我喜欢将我的 show table stats tablename 保存到配置单元 table,我这样做但收到错误消息:

[r001d01i1p:21000] > create table mystats as
                       > show table stats eq_cmplx_exec_master;

错误:

Query: create table mystats as show table stats eq_cmplx_exec_master ERROR: AnalysisException: Syntax error in line 2: show table stats eq_cmplx_exec_master ^ Encountered: SHOW Expected: SELECT, VALUES, WITH

CAUSED BY: Exception: Syntax error

谁能帮我解决一下,非常感谢。

理想情况下,我希望新的 table 包含两个额外的列:ID、tablename

经过一些研究,这是我最终得到的结果,它可以完美地工作:

impala-shell -i host-10-17-101-252:25003 -k -q "show table stats dbo" -d default --quiet -B -c -o table_stats.txt