SHOW TABLES

SHOW TABLES

Synopsis:

  1. SHOW TABLES
  2. [CATALOG [catalog_identifier |
  3. LIKE pattern]]?
  4. [INCLUDE FROZEN]?
  5. [table_identifier |
  6. LIKE pattern]?

Catalog (cluster) identifier. Supports wildcards (*).

SQL LIKE pattern matching catalog names.

Whether or not to include frozen indices.

Single table (index or data stream) identifier or double-quoted multi-target pattern.

SQL LIKE pattern matching table names.

See index patterns for more information about patterns.

Description: List the tables available to the current user and their type.

  1. SHOW TABLES;
  2. catalog | name | type | kind
  3. ---------------+---------------+----------+---------------
  4. javaRestTest |emp |TABLE |INDEX
  5. javaRestTest |employees |VIEW |ALIAS
  6. javaRestTest |library |TABLE |INDEX

Match multiple indices by using Elasticsearch multi-target syntax notation:

  1. SHOW TABLES "*,-l*";
  2. catalog | name | type | kind
  3. ---------------+---------------+----------+---------------
  4. javaRestTest |emp |TABLE |INDEX
  5. javaRestTest |employees |VIEW |ALIAS

One can also use the LIKE clause to restrict the list of names to the given pattern.

The pattern can be an exact match:

  1. SHOW TABLES LIKE 'emp';
  2. catalog | name | type | kind
  3. ---------------+---------------+----------+---------------
  4. javaRestTest |emp |TABLE |INDEX

Multiple chars:

  1. SHOW TABLES LIKE 'emp%';
  2. catalog | name | type | kind
  3. ---------------+---------------+----------+---------------
  4. javaRestTest |emp |TABLE |INDEX
  5. javaRestTest |employees |VIEW |ALIAS

A single char:

  1. SHOW TABLES LIKE 'em_';
  2. catalog | name | type | kind
  3. ---------------+---------------+----------+---------------
  4. javaRestTest |emp |TABLE |INDEX

Or a mixture of single and multiple chars:

  1. SHOW TABLES LIKE '%em_';
  2. catalog | name | type | kind
  3. ---------------+---------------+----------+---------------
  4. javaRestTest |emp |TABLE |INDEX

List tables within remote clusters whose names are matched by a wildcard:

  1. SHOW TABLES CATALOG 'my_*' LIKE 'test_emp%';
  2. catalog | name | type | kind
  3. -----------------+---------------+---------------+---------------
  4. my_remote_cluster|test_emp |TABLE |INDEX
  5. my_remote_cluster|test_emp_copy |TABLE |INDEX