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:57:57 GMT
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1720#discussion_r158515750
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/metadata/datatype/DataTypes.java
---
    @@ -184,4 +224,60 @@ public static boolean isMapType(DataType dataType) {
         return dataType.getId() == MAP_TYPE_ID;
       }
     
    +  /**
    +   * This class is added to support backword compatibility with table info object, where
DATATYPE
    +   * is string in old version and OBJECT in new version
    +   */
    +  public static class DataTypeAdapter extends TypeAdapter<Object> {
    +
    +    private static DataTypeAdapter dataTypeAdapter = new DataTypeAdapter();
    +
    +    private DataTypeAdapter() {
    +    }
    +
    +    public static DataTypeAdapter getInstance() {
    +      return dataTypeAdapter;
    +    }
    +
    +    @Override public void write(JsonWriter jsonWriter, Object o) throws IOException {
    +    }
    +
    +    @Override public Object read(JsonReader jsonReader) throws IOException {
    +      DataType newObj;
    --- End diff --
    
    change newObj to dataType


---

Mime
View raw message