Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1919#discussion_r165809376
  
    --- Diff: 
core/src/main/java/org/apache/carbondata/core/metadata/schema/datamap/DataMapProvider.java
 ---
    @@ -27,6 +27,40 @@
      */
     
     public enum DataMapProvider {
    -  PREAGGREGATE,
    -  TIMESERIES;
    +  PREAGGREGATE("org.apache.carbondata.core.datamap.AggregateDataMap", 
"preaggregate"),
    +  TIMESERIES("org.apache.carbondata.core.datamap.TimeSeriesDataMap", 
"timeseries");
    +
    +  /**
    +   * Fully qualified class name of datamap
    +   */
    +  private String className;
    +
    +  /**
    +   * Short name representation of datamap
    +   */
    +  private String shortName;
    +
    +  DataMapProvider(String className, String shortName) {
    +    this.className = className;
    +    this.shortName = shortName;
    +  }
    +
    +  public String getClassName() {
    +    return className;
    +  }
    +
    +  private boolean isEqual(String dataMapClass) {
    +    return (dataMapClass != null && (dataMapClass.equals(className) ||
    +        dataMapClass.equalsIgnoreCase(shortName)));
    +  }
    +
    +  public static DataMapProvider getDataMapProvider(String dataMapClass) {
    +    if (TIMESERIES.isEqual(dataMapClass)) {
    +      return TIMESERIES;
    +    } else if (PREAGGREGATE.isEqual(dataMapClass)) {
    +      return PREAGGREGATE;
    +    } else {
    +      throw new UnsupportedOperationException("Unknown data map type " + 
dataMapClass);
    --- End diff --
    
    ok


---

Reply via email to