查询以查找 Hue 上 impala/hive 中所有表的列数

发布于 2025-01-11 02:59:00 字数 490 浏览 0 评论 0原文

我正在尝试从同一架构的 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 技术交流群。

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

发布评论

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

评论(1

新人笑 2025-01-18 02:59:00

在 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.

enter image description here

Impala is still behind, with JIRAs IMPALA-554 Implement INFORMATION_SCHEMA in Impala and IMPALA-1761 still unresolved.

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