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
---