public static AggregationFunctionType getStoredType(AggregationFunctionType aggregationType) {
    switch (aggregationType) {
      case DISTINCTCOUNTRAWHLL:
        return AggregationFunctionType.DISTINCTCOUNTHLL;
      case PERCENTILERAWEST:
        return AggregationFunctionType.PERCENTILEEST;
      case PERCENTILERAWTDIGEST:
        return AggregationFunctionType.PERCENTILETDIGEST;
      case DISTINCTCOUNTRAWTHETASKETCH:
        return AggregationFunctionType.DISTINCTCOUNTTHETASKETCH;
      case DISTINCTCOUNTRAWHLLPLUS:
        return AggregationFunctionType.DISTINCTCOUNTHLLPLUS;
      case DISTINCTCOUNTRAWINTEGERSUMTUPLESKETCH:
      case AVGVALUEINTEGERSUMTUPLESKETCH:
      case SUMVALUESINTEGERSUMTUPLESKETCH:
        return AggregationFunctionType.DISTINCTCOUNTTUPLESKETCH;
      case DISTINCTCOUNTRAWCPCSKETCH:
        return AggregationFunctionType.DISTINCTCOUNTCPCSKETCH;
      case DISTINCTCOUNTRAWULL:
        return AggregationFunctionType.DISTINCTCOUNTULL;
      default:
        return aggregationType;
    }
  }
@Test
  public void testGetStoredType() {
    assertEquals(getStoredType(AggregationFunctionType.DISTINCTCOUNTRAWHLL), AggregationFunctionType.DISTINCTCOUNTHLL);
    assertEquals(getStoredType(AggregationFunctionType.PERCENTILERAWTDIGEST),
        AggregationFunctionType.PERCENTILETDIGEST);
    assertEquals(getStoredType(AggregationFunctionType.DISTINCTCOUNTRAWTHETASKETCH),
        AggregationFunctionType.DISTINCTCOUNTTHETASKETCH);
    assertEquals(getStoredType(AggregationFunctionType.DISTINCTCOUNTRAWINTEGERSUMTUPLESKETCH),
        AggregationFunctionType.DISTINCTCOUNTTUPLESKETCH);
    assertEquals(getStoredType(AggregationFunctionType.SUMVALUESINTEGERSUMTUPLESKETCH),
        AggregationFunctionType.DISTINCTCOUNTTUPLESKETCH);
    assertEquals(getStoredType(AggregationFunctionType.AVGVALUEINTEGERSUMTUPLESKETCH),
        AggregationFunctionType.DISTINCTCOUNTTUPLESKETCH);
    assertEquals(getStoredType(AggregationFunctionType.DISTINCTCOUNTHLLPLUS),
        AggregationFunctionType.DISTINCTCOUNTHLLPLUS);
    // Default case
    assertEquals(getStoredType(AggregationFunctionType.COUNT), AggregationFunctionType.COUNT);
  }