carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jackylk <...@git.apache.org>
Subject [GitHub] carbondata pull request #1720: [CARBONDATA-1935]fix the backword compatibili...
Date Fri, 22 Dec 2017 15:33:35 GMT
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1720#discussion_r158511774
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/metadata/datatype/DataTypes.java
---
    @@ -112,6 +118,40 @@ public static DataType valueOf(int id) {
         }
       }
     
    +  public static DataType valueOf(String name) {
    +    if (STRING.getName().equalsIgnoreCase(name)) {
    +      return STRING;
    +    } else if (DATE.getName().equalsIgnoreCase(name)) {
    +      return DATE;
    +    } else if (TIMESTAMP.getName().equalsIgnoreCase(name)) {
    +      return TIMESTAMP;
    +    } else if (BOOLEAN.getName().equalsIgnoreCase(name)) {
    +      return BOOLEAN;
    +    } else if (BYTE.getName().equalsIgnoreCase(name)) {
    +      return BYTE;
    +    } else if (SHORT.getName().equalsIgnoreCase(name)) {
    +      return SHORT;
    +    } else if (SHORT_INT.getName().equalsIgnoreCase(name)) {
    +      return SHORT_INT;
    +    } else if (INT.getName().equalsIgnoreCase(name)) {
    +      return INT;
    +    } else if (LONG.getName().equalsIgnoreCase(name)) {
    +      return LONG;
    +    } else if (LEGACY_LONG.getName().equalsIgnoreCase(name)) {
    +      return LEGACY_LONG;
    +    } else if (FLOAT.getName().equalsIgnoreCase(name)) {
    +      return FLOAT;
    +    } else if (DOUBLE.getName().equalsIgnoreCase(name)) {
    +      return DOUBLE;
    +    } else if (NULL.getName().equalsIgnoreCase(name)) {
    +      return NULL;
    +    } else if (BYTE_ARRAY.getName().equalsIgnoreCase(name)) {
    +      return BYTE_ARRAY;
    +    } else {
    +      throw new RuntimeException("create DataType with invalid name: " + name);
    --- End diff --
    
    how about struct and array?


---

Mime
View raw message