public static TableConfig overwriteTableConfigForTier(TableConfig tableConfig, @Nullable String tier) {
    if (tier == null) {
      return tableConfig;
    }
    try {
      boolean updated = false;
      JsonNode tblCfgJson = tableConfig.toJsonNode();
      // Apply tier specific overwrites for `tableIndexConfig`
      JsonNode tblIdxCfgJson = tblCfgJson.get(TableConfig.INDEXING_CONFIG_KEY);
      if (tblIdxCfgJson != null && tblIdxCfgJson.has(TableConfig.TIER_OVERWRITES_KEY)) {
        JsonNode tierCfgJson = tblIdxCfgJson.get(TableConfig.TIER_OVERWRITES_KEY).get(tier);
        if (tierCfgJson != null) {
          LOGGER.debug("Got table index config overwrites: {} for tier: {}", tierCfgJson, tier);
          overwriteConfig(tblIdxCfgJson, tierCfgJson);
          updated = true;
        }
      }
      // Apply tier specific overwrites for `fieldConfigList`
      JsonNode fieldCfgListJson = tblCfgJson.get(TableConfig.FIELD_CONFIG_LIST_KEY);
      if (fieldCfgListJson != null && fieldCfgListJson.isArray()) {
        Iterator<JsonNode> fieldCfgListItr = fieldCfgListJson.elements();
        while (fieldCfgListItr.hasNext()) {
          JsonNode fieldCfgJson = fieldCfgListItr.next();
          if (!fieldCfgJson.has(TableConfig.TIER_OVERWRITES_KEY)) {
            continue;
          }
          JsonNode tierCfgJson = fieldCfgJson.get(TableConfig.TIER_OVERWRITES_KEY).get(tier);
          if (tierCfgJson != null) {
            LOGGER.debug("Got field index config overwrites: {} for tier: {}", tierCfgJson, tier);
            overwriteConfig(fieldCfgJson, tierCfgJson);
            updated = true;
          }
        }
      }
      if (updated) {
        LOGGER.debug("Got overwritten table config: {} for tier: {}", tblCfgJson, tier);
        return JsonUtils.jsonNodeToObject(tblCfgJson, TableConfig.class);
      } else {
        LOGGER.debug("No table config overwrites for tier: {}", tier);
        return tableConfig;
      }
    } catch (IOException e) {
      LOGGER.warn("Failed to overwrite table config for tier: {} for table: {}", tier, tableConfig.getTableName(), e);
      return tableConfig;
    }
  }
@Test
  public void testOverwriteTableConfigForTierWithError()
      throws Exception {
    TableConfig tableConfig = new TableConfigBuilder(TableType.OFFLINE).setTableName(TABLE_NAME)
        .setTierOverwrites(JsonUtils.stringToJsonNode("{\"coldTier\": {\"starTreeIndexConfigs\": {}}}")).build();
    TableConfig tierTblCfg = TableConfigUtils.overwriteTableConfigForTier(tableConfig, "coldTier");
    Assert.assertEquals(tierTblCfg, tableConfig);
  }