If you no longer require a mapping table, you can execute the DROP MAPPING TABLE statement to delete the mapping table. You can delete multiple mapping tables in a single request.
For more information about the DROP MAPPING TABLE statement, see Delete mapping tables.
Prerequisites
An OTSClient instance is initialized. For more information, see Initialize an OTSClient instance.
A mapping table is created. For more information, see Create a mapping table.
Usage notes
Tablestore SDK for .NET V5.0.0 or later supports SQL queries. To perform SQL queries by using Tablestore SDK for .NET, make sure that your SDK version is 5.0.0 or later. We recommend that you use the latest SDK. For more information, see Version history of Tablestore SDK for .NET.
Parameters
Parameter | Description |
query | The SQL statement. Configure this parameter based on the required feature. |
Example
The following sample code provides an example on how to execute the drop mapping table test_table statement to delete mapping tables that are created for the table named test_table:
/// <summary>
/// Delete a mapping table for a data table.
/// </summary>
/// <param name="otsClient"></param>
public static void DropMappingTable(OTSClient otsClient)
{
SQLQueryRequest sqlQuery = new SQLQueryRequest("drop mapping table test_table");
SQLQueryResponse sqlQueryResponse = otsClient.SQLQuery(sqlQuery);
}
References
If an attribute column of a data table changes, you can execute the
ALTER TABLE
statement to modify the mapping table that is created for the data table. For more information, see Update attribute columns of mapping tables.If you want to accelerate data queries and computing by executing SQL statements, you can create a secondary index or a search index. For more information, see Index selection policy and Computing pushdown.
You can also use computing engines, such as MaxCompute, Spark, Hive, HadoopMR, Function Compute, Flink, and PrestoDB, to compute and analyze data in tables. For more information, see Overview.
If your business requires multi-dimensional queries and data analysis, you can create a search index and specify the required attribute columns as the fields of the search index. Then, you can query and analyze data by using the search index. For example, you can use a search index to perform queries based on non-primary key columns, Boolean queries, and fuzzy queries. You can also use a search index to obtain the maximum and minimum values, collect statistics about the number of rows, and group query results. For more information, see Search index.