Tous les produits
Search
Centre de documentation

Tablestore:Create an analytical store

Dernière mise à jour :Aug 19, 2026

Prérequis

Exemple

func CreateTimeseriesAnalyticalStore(client *tablestore.TimeseriesClient) {
    //Specify the name of the analytical store.
    analyticalStore := tablestore.NewTimeseriesAnalyticalStore("test_analytical_store")
    //Specify the TTL of the analytical store in seconds.
    analyticalStore.SetTimeToLive(2592000)
    //Specify the mode in which the data in the time series table is synchronized to the analytical store.
    analyticalStore.SetSyncOption(tablestore.SYNC_TYPE_INCR)
    //Specify the name of the time series table.
    request := tablestore.NewCreateTimeseriesAnalyticalStoreRequest("test_timeseries_table", analyticalStore)
    _, err := client.CreateTimeseriesAnalyticalStore(request)
    if err != nil {
         log.Fatal(err)
    }
}