SHOW TABLES
编辑SHOW TABLES
编辑概要
SHOW TABLES [CATALOG [catalog_identifier | LIKE pattern]]? [INCLUDE FROZEN]? [table_identifier | LIKE pattern]?
有关模式的更多信息,请参阅 索引模式。
描述:列出当前用户可用的表及其类型。
SHOW TABLES; catalog | name | type | kind ---------------+---------------+----------+--------------- javaRestTest |emp |TABLE |INDEX javaRestTest |employees |VIEW |ALIAS javaRestTest |library |TABLE |INDEX
可以使用 Elasticsearch 多目标语法表示法来匹配多个索引
SHOW TABLES "*,-l*"; catalog | name | type | kind ---------------+---------------+----------+--------------- javaRestTest |emp |TABLE |INDEX javaRestTest |employees |VIEW |ALIAS
还可以使用 LIKE
子句将名称列表限制为给定的模式。
该模式可以是精确匹配
SHOW TABLES LIKE 'emp'; catalog | name | type | kind ---------------+---------------+----------+--------------- javaRestTest |emp |TABLE |INDEX
多个字符
SHOW TABLES LIKE 'emp%'; catalog | name | type | kind ---------------+---------------+----------+--------------- javaRestTest |emp |TABLE |INDEX javaRestTest |employees |VIEW |ALIAS
单个字符
SHOW TABLES LIKE 'em_'; catalog | name | type | kind ---------------+---------------+----------+--------------- javaRestTest |emp |TABLE |INDEX
或单字符和多字符的混合
SHOW TABLES LIKE '%em_'; catalog | name | type | kind ---------------+---------------+----------+--------------- javaRestTest |emp |TABLE |INDEX
列出名称与通配符匹配的远程集群中的表
SHOW TABLES CATALOG 'my_*' LIKE 'test_emp%'; catalog | name | type | kind -----------------+---------------+---------------+--------------- my_remote_cluster|test_emp |TABLE |INDEX my_remote_cluster|test_emp_copy |TABLE |INDEX