public static Map<String, AggregationFunctionType> getAggregationTypes(Map<String, String> taskConfig) {
    Map<String, AggregationFunctionType> aggregationTypes = new HashMap<>();
    for (Map.Entry<String, String> entry : taskConfig.entrySet()) {
      String key = entry.getKey();
      if (key.endsWith(MergeTask.AGGREGATION_TYPE_KEY_SUFFIX)) {
        String column = key.substring(0, key.length() - AGGREGATION_TYPE_KEY_SUFFIX_LENGTH);
        aggregationTypes.put(column, AggregationFunctionType.getAggregationFunctionType(entry.getValue()));
      }
    }
    return aggregationTypes;
  }
@Test
  public void testGetAggregationTypes() {
    Map<String, String> taskConfig = new HashMap<>();
    taskConfig.put("colA.aggregationType", "sum");
    taskConfig.put("colB.aggregationType", "Min");
    taskConfig.put("colC.aggregationType", "MaX");

    Map<String, AggregationFunctionType> aggregationTypes = MergeTaskUtils.getAggregationTypes(taskConfig);
    assertEquals(aggregationTypes.size(), 3);
    assertEquals(aggregationTypes.get("colA"), AggregationFunctionType.SUM);
    assertEquals(aggregationTypes.get("colB"), AggregationFunctionType.MIN);
    assertEquals(aggregationTypes.get("colC"), AggregationFunctionType.MAX);

    taskConfig.put("colD.aggregationType", "unsupported");
    try {
      MergeTaskUtils.getAggregationTypes(taskConfig);
      fail();
    } catch (IllegalArgumentException e) {
      // Expected
    }
  }