This topic describes how to delete a data table in an instance by using Tablestore SDK for Java.
Usage notes
If search indexes are created for the data table that you want to delete, you must delete the search indexes before you can delete the data table.
If secondary indexes are created for the data table that you want to delete, the secondary indexes are deleted when you delete the data table.
After the data table and secondary indexes are deleted, they cannot be recovered. Proceed with caution.
Prerequisite
A client is initialized. For more information, see Initialize a Tablestore client.
Method
public DeleteTableResponse deleteTable(DeleteTableRequest deleteTableRequest) throws TableStoreException, ClientExceptionSample code
The following sample code provides an example on how to delete a data table named test_table:
public static void deleteTableExample(SyncClient client) {
DeleteTableRequest request = new DeleteTableRequest("test_table");
client.deleteTable(request);
}References
For more information, see Delete a time series table.