Use Tablestore SDK for Go to delete a Lastpoint index without deleting the source time series table or its data.
Usage notes
-
Tablestore SDK for Go V1.7.15 or later is required for the Lastpoint index feature. Make sure you have obtained Tablestore SDK for Go V1.7.15 or later before using this feature.
-
Before deleting a Lastpoint index, make sure it is no longer in use by your application.
-
A deleted Lastpoint index cannot be recovered. Proceed with caution.
Prerequisites
-
A Lastpoint index is created. For more information, see Create a Lastpoint index.
-
A TimeseriesClient is initialized. For more information, see Initialize a Tablestore client.
Parameters
|
Parameter |
Description |
|
timeseriesTableName |
The name of the time series table. |
|
lastpointIndexName |
The name of the Lastpoint index. |
Example
The following sample code provides an example on how to delete a Lastpoint index named last_point_index that is created for a time series table name timeseries_table:
func deleteTimeseriesLastpointIndex(client *tablestore.TimeseriesClient) {
request := tablestore.NewDeleteTimeseriesLastpointIndexRequest("test_timeseries_table", "last_point_index")
_, err := client.DeleteTimeseriesLastpointIndex(request)
if err != nil {
log.Fatal(err)
}
}