carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipesala <...@git.apache.org>
Subject [GitHub] carbondata pull request #1417: [CARBONDATA-1594] Add precision and scale to ...
Date Mon, 30 Oct 2017 08:31:01 GMT
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1417#discussion_r147638842
  
    --- 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 --
    
    why we should create default? Already scale and precision must be available inside columnschema.I
guess It would be an issue  if we create with default 


---

Mime
View raw message