Impala:显示类似查询的表格 [英] Impala: Show tables like query

查看:94
本文介绍了Impala:显示类似查询的表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Impala,并使用如下所示的模式从数据库中获取表的列表.

I am working with Impala and fetching the list of tables from the database with some pattern like below.

假设我有一个数据库 bank ,该数据库下的表如下所示.

Assume i have a Database bank, and tables under this database are like below.

cust_profile
cust_quarter1_transaction
cust_quarter2_transaction
product_cust_xyz
....
....
etc

现在我正在过滤

show tables in bank like '*cust*'

它正在返回预期的结果,例如,表中名称中有一个 cust 字样.

It is returning the expected results like, which are the tables has a word cust in its name.

现在我的要求是我希望所有名称中具有 cust 并且表中不具有 quarter2 的表.

Now my requirement is i want all the tables which will have cust in its name and table should not have quarter2.

有人可以帮助我解决此问题吗?

Can someone please help me how to solve this issue.

推荐答案

从shell执行,然后过滤

impala-shell -q "show tables in bank like '*cust*'" | grep -v 'quarter2'

这篇关于Impala:显示类似查询的表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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