Update a time series table

更新时间: 2026-04-29 20:37:02

You can call the UpdateTimeseriesTable operation to modify the configurations of a time series table, such as the time to live (TTL) of data or time series metadata.

Prerequisites

Parameters

For more information, see Create a time series table.

Examples

The following example updates the time to live (TTL) of a time series table.

func UpdateTimeseriesTableSample(client *tablestore.TimeseriesClient, timeseriesTableName string) {
    // Construct the TTL configuration of the time series table.
    ttlInSeconds := int64(964000)
    timeseriesTableOptions := tablestore.NewTimeseriesTableOptions(ttlInSeconds)

    updateTimeseriesTableRequest := tablestore.NewUpdateTimeseriesTableRequest(timeseriesTableName)
    updateTimeseriesTableRequest.SetTimeseriesTableOptions(timeseriesTableOptions)

    updateTimeseriesTableResponse, err := client.UpdateTimeseriesTable(updateTimeseriesTableRequest)
    if err != nil {
        fmt.Println("[Error] UpdateTimeseriesTable failed:", err)
        return
    }
    fmt.Println("[Info] UpdateTimeseriesTable succeeded. RequestId:", updateTimeseriesTableResponse.RequestId)
}

References

上一篇: Create a time series table 下一篇: Query the names of time series tables
阿里云首页 表格存储 相关技术圈