List mapping tables

Updated at:

Tablestore SDK for Python lists the names of mapping tables in the current instance.

Prerequisites

  • Install Tablestore SDK for Python and initialize a client.

  • SQL query requires version 5.4.2 or later. We recommend that you use the latest version.

Description

Call the exe_sql_query method to execute a SHOW TABLES statement and list mapping tables in the current instance.

def exe_sql_query(self, query)
query = "SHOW TABLES"
row_list, _, _ = client.exe_sql_query(query)

for row in row_list:
    print(row.attribute_columns[0][1])

Parameters

The exe_sql_query method contains the following parameter.

Name

Type

Description

query (required)

String

The SHOW TABLES statement to execute.

Response

The exe_sql_query method returns a tuple that contains the following elements.

Element

Type

Description

row_list

List[Row]

A list of mapping table names. The result column is named Tables_in_<instance_name>, where <instance_name> is the instance name.

table_capacity_units

List[Tuple]

Read and write CUs consumed by data tables. Each tuple contains a table name and a CapacityUnit object.

search_capacity_units

List[Tuple]

Read and write CUs consumed by search indexes. Each tuple contains a search index name and a CapacityUnit object.