Delete a table

Updated at:

Tablestore SDK for Java deletes a Wide Column model table and all of its secondary indexes.

Prerequisites

Install the Tablestore SDK for Java and initialize the client.

Function description

Call deleteTable to delete a table.

public DeleteTableResponse deleteTable(DeleteTableRequest deleteTableRequest) throws TableStoreException, ClientException
Important

If the table has search indexes, delete the search indexes before you delete the table. Deleting a table also deletes all of its secondary indexes. Deleted tables and secondary indexes cannot be recovered.

The following example deletes a table named example_table.

DeleteTableRequest request = new DeleteTableRequest("example_table");
client.deleteTable(request);

Parameters

DeleteTableRequest contains the following parameter.

Name

Type

Description

tableName (required)

String

The name of the table.