All Products
Search
Document Center

Tablestore:List mapping tables

Last Updated:Jul 30, 2026

Use Tablestore SDK for Java to list all mapping tables in the current Tablestore instance.

Prerequisites

Description

Call the sqlQuery method to execute a SHOW TABLES statement and query the names of all mapping tables in the current Tablestore instance.

SQLQueryResponse sqlQuery(SQLQueryRequest request)

The following example lists the mapping tables in the current instance and calls SQLUtils.parseShowTablesResponse to parse the result into a list of mapping table names.

SQLQueryRequest request = new SQLQueryRequest("SHOW TABLES");
SQLQueryResponse response = client.sqlQuery(request);

List<String> mappingTables = SQLUtils.parseShowTablesResponse(response);
for (String mappingTable : mappingTables) {
    System.out.println(mappingTable);
}

Parameters

SQLQueryRequest contains the following parameter.

Name

Type

Description

query (required)

String

The SHOW TABLES statement to execute.

Response

SQLQueryResponse contains the following fields related to the mapping table list.

Field

Type

Description

type

SQLStatementType

Call getSQLStatementType() to obtain the SQL statement type. SQL_SHOW_TABLE is returned for a SHOW TABLES statement.

rows

ByteString

The serialized list of mapping table names. Call getSQLResultSet() to obtain the parsed SQLResultSet, or call SQLUtils.parseShowTablesResponse() to directly obtain a List<String> of mapping table names.