You can call the DeleteTable operation to delete a table from an instance.
Usage notes
You cannot restore deleted data tables. Proceed with caution.
When you delete a data table, the data in the data table and the secondary indexes that are created for the data table are deleted. You cannot restore deleted data or secondary indexes. Proceed with caution.
Prerequisites
An OTSClient instance is initialized. For more information, see Initialize an OTSClient instance.
A data table is created. For more information, see Create a data table.
If a search index is created for the data table that you want to delete, you must delete the search index before you delete the data table. For more information, see Delete search indexes.
Parameters
Parameter | Description |
tableName | The name of the data table. |
Examples
The following sample code provides an example on how to delete a data table:
private static void deleteTable(SyncClient client) {
// Specify the name of the data table.
DeleteTableRequest request = new DeleteTableRequest("<TABLE_NAME>");
client.deleteTable(request);
}
References
For more information about the API operation, see DeleteTable. For the complete sample code, visit DeleteTable@GitHub.
If an error occurs when you call this operation, search for the error cause in Error codes based on the error message and troubleshoot the error.