Impala: 像查询一样显示表
Impala: Show tables like query
我正在使用 Impala 并使用如下模式从数据库中获取 table 的列表。
假设我有一个数据库bank
,这个数据库下的table如下。
cust_profile
cust_quarter1_transaction
cust_quarter2_transaction
product_cust_xyz
....
....
etc
现在我正在过滤
show tables in bank like '*cust*'
它正在返回预期的结果,例如 table 的名称中有一个单词 cust
。
现在我的要求是我想要所有 table 名称中包含 cust
而 table 不应该包含 quarter2
.
谁能帮我解决这个问题。
从shell执行然后过滤
impala-shell -q "show tables in bank like '*cust*'" | grep -v 'quarter2'
查询 Metastore
mysql -u root -p -e "select TBL_NAME from metastore.TBLS where TBL_NAME like '%cust%' and TBL_NAME not like '%quarter2%'";
我正在使用 Impala 并使用如下模式从数据库中获取 table 的列表。
假设我有一个数据库bank
,这个数据库下的table如下。
cust_profile
cust_quarter1_transaction
cust_quarter2_transaction
product_cust_xyz
....
....
etc
现在我正在过滤
show tables in bank like '*cust*'
它正在返回预期的结果,例如 table 的名称中有一个单词 cust
。
现在我的要求是我想要所有 table 名称中包含 cust
而 table 不应该包含 quarter2
.
谁能帮我解决这个问题。
从shell执行然后过滤
impala-shell -q "show tables in bank like '*cust*'" | grep -v 'quarter2'
查询 Metastore
mysql -u root -p -e "select TBL_NAME from metastore.TBLS where TBL_NAME like '%cust%' and TBL_NAME not like '%quarter2%'";