private static void updateStatsForAlterTable(RawStore rawStore, Table tblBefore, Table tblAfter, String catalogName,
      String dbName, String tableName) throws Exception {
    ColumnStatistics colStats = null;
    if (tblBefore.isSetPartitionKeys()) {
      List<Partition> parts = sharedCache.listCachedPartitions(catalogName, dbName, tableName, -1);
      for (Partition part : parts) {
        colStats = updateStatsForAlterPart(rawStore, tblBefore, catalogName, dbName, tableName, part);
      }
    }

    rawStore.alterTable(catalogName, dbName, tblBefore.getTableName(), tblAfter, null);

    Set<String> deletedCols = new HashSet<>();
    List<ColumnStatistics> multiColumnStats = HiveAlterHandler.getColumnStats(rawStore, tblBefore);
    multiColumnStats.forEach(cs ->
      deletedCols.addAll(HiveAlterHandler.filterColumnStatsForTableColumns(tblBefore.getSd().getCols(), cs)
          .stream().map(ColumnStatisticsObj::getColName).collect(Collectors.toList())));

    if (multiColumnStats.size() > 1) {
      throw new RuntimeException("CachedStore can only be enabled for Hive engine");
    }
    List<ColumnStatisticsObj> statisticsObjs = multiColumnStats.isEmpty() ? null : multiColumnStats.get(0).getStatsObj();
    if (colStats != null) {
      sharedCache.alterTableAndStatsInCache(catalogName, dbName, tableName, tblAfter.getWriteId(), statisticsObjs,
          tblAfter.getParameters());
    }
    for (String column : deletedCols) {
      sharedCache.removeTableColStatsFromCache(catalogName, dbName, tableName, column);
    }
  }
Similar to setConf but used from within the tests
This does start the background thread for prewarm and update
@param conf
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/CachedStore.java