Impala: 显示类似于查询的表

7
我正在使用Impala,并使用以下某种模式从数据库中获取表列表。
假设我有一个名为bank的数据库,该数据库下的表如下。
cust_profile
cust_quarter1_transaction
cust_quarter2_transaction
product_cust_xyz
....
....
etc

现在我正在进行过滤,像这样:

show tables in bank like '*cust*'

它返回了预期的结果,如表名中包含单词cust的表。
现在我的要求是,我想要所有表格中都有cust且不包含quarter2的表。
请问有人能帮我解决这个问题吗?
2个回答

8

从 shell 中执行并过滤

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

1
查询元数据存储。
 mysql -u root -p -e "select TBL_NAME from metastore.TBLS where TBL_NAME like '%cust%' and TBL_NAME not like '%quarter2%'";

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接