Github user jackylk commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1417#discussion_r147670204
--- Diff:
core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java ---
@@ -1862,9 +1863,31 @@ public static TableInfo
convertGsonToTableInfo(Map<String, String> properties) {
builder.append(part);
}
TableInfo tableInfo = gson.fromJson(builder.toString(),
TableInfo.class);
+ updateDecimalType(tableInfo);
return tableInfo;
}
+ // update decimal type inside `tableInfo` to set scale and precision, if
there are any decimal
+ private static void updateDecimalType(TableInfo tableInfo) {
+ List<ColumnSchema> deserializedColumns =
tableInfo.getFactTable().getListOfColumns();
+ for (ColumnSchema column : deserializedColumns) {
+ DataType dataType = column.getDataType();
+ if (DataTypes.isDecimal(dataType)) {
+ column.setDataType(DataTypes.createDefaultDecimalType());
--- End diff --
ok, I will add back scale and precision in `ColumnSchema` and use it here
---