查询以查找 Hue 上 impala/hive 中所有表的列数
我正在尝试从同一架构的 Impala 中获取单个表/视图列表的总列数。
但是我想扫描该架构中的所有表以捕获单个查询中的列?
我已经在 Oracle Exadata 中进行了类似的练习,但是由于我是 Impala 新手,有没有办法捕获?
Oracle Exadata 查询我使用
select owner, table_name as view_name, count(*) as counts
from dba_tab_cols /*DBA_TABLES_COLUMNS*/
where (owner, table_name) in
(
select owner, view_name
from dba_views /*DBA_VIEWS*/
where 1=1
and owner='DESIRED_SCHEMA_NAME'
)
group by owner ,table_name
order by counts desc;
Impala
I am trying to fetch a count of total columns for a list of individual tables/views from Impala from the same schema.
however i wanted to scan through all the tables from that schema to capture the columns in a single query ?
i have already performed a similar excercise from Oracle Exadata ,however since i a new to Impala is there a way to capture ?
Oracle Exadata query i used
select owner, table_name as view_name, count(*) as counts
from dba_tab_cols /*DBA_TABLES_COLUMNS*/
where (owner, table_name) in
(
select owner, view_name
from dba_views /*DBA_VIEWS*/
where 1=1
and owner='DESIRED_SCHEMA_NAME'
)
group by owner ,table_name
order by counts desc;
Impala
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 Hive v.3.0 及更高版本中,您拥有可以从 Hue 查询的
INFORMATION_SCHEMA
数据库,以获取所需的列信息。Impala 仍然落后,JIRA IMPALA-554 在 Impala 中实现 INFORMATION_SCHEMA 且 IMPALA-1761 仍未解决。
In Hive v.3.0 and up, you have
INFORMATION_SCHEMA
db that can be queried from Hue to get column info that you need.Impala is still behind, with JIRAs IMPALA-554 Implement INFORMATION_SCHEMA in Impala and IMPALA-1761 still unresolved.