Github user jackylk commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1795#discussion_r161792809 --- Diff: processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortDataRows.java --- @@ -270,7 +270,7 @@ private void writeDataToFile(Object[][] recordHolderList, int entryCountLocal, F } else if (dataType == DataTypes.SHORT) { stream.writeShort((Short) value); } else if (dataType == DataTypes.INT) { - stream.writeInt((Integer) value); + stream.writeInt(Integer.parseInt(value.toString())); --- End diff -- But what is the root cause of this bug? I think your change (convert to string and then int) is like hiding this bug. --- |
In reply to this post by qiuchenjian-2
Github user anubhav100 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1795#discussion_r161794151 --- Diff: processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortDataRows.java --- @@ -270,7 +270,7 @@ private void writeDataToFile(Object[][] recordHolderList, int entryCountLocal, F } else if (dataType == DataTypes.SHORT) { stream.writeShort((Short) value); } else if (dataType == DataTypes.INT) { - stream.writeInt((Integer) value); + stream.writeInt(Integer.parseInt(value.toString())); --- End diff -- @jackylyk ok i get your point you mean we should handle it at the base root level ok I am looking into it --- |
In reply to this post by qiuchenjian-2
Github user anubhav100 commented on the issue:
https://github.com/apache/carbondata/pull/1795 @jackylk **here is the root reason** **when we apply the alter table command with default value i;e "alter table customer1 add columns (intfield int) TBLPROPERTIES ('DEFAULT.VALUE.intfield'='10')") that value is always return as the long object in restructure util thats why compaction failed because the column value for newly added column is long but the column type is int** it is wrongly written in restructure util this code is wrong public static Object getMeasureDefaultValue(ColumnSchema columnSchema, byte[] defaultValue) { Object measureDefaultValue = null; if (!isDefaultValueNull(defaultValue)) { String value = null; DataType dataType = columnSchema.getDataType(); if (dataType == DataTypes.SHORT || dataType == DataTypes.INT || dataType == DataTypes.LONG) { value = new String(defaultValue, Charset.forName(CarbonCommonConstants.DEFAULT_CHARSET)); measureDefaultValue = Long.parseLong(value); } else if (DataTypes.isDecimal(dataType)) { BigDecimal decimal = DataTypeUtil.byteToBigDecimal(defaultValue); if (columnSchema.getScale() > decimal.scale()) { decimal = decimal.setScale(columnSchema.getScale(), RoundingMode.HALF_UP); } measureDefaultValue = decimal; } else { value = new String(defaultValue, Charset.forName(CarbonCommonConstants.DEFAULT_CHARSET)); Double parsedValue = Double.valueOf(value); if (!Double.isInfinite(parsedValue) && !Double.isNaN(parsedValue)) { measureDefaultValue = parsedValue; } } } return measureDefaultValue; } this code is always returning a long value objetc that is wrong i corrected it as */ public static Object getMeasureDefaultValue(ColumnSchema columnSchema, byte[] defaultValue) { Object measureDefaultValue = null; if (!isDefaultValueNull(defaultValue)) { String value = null; DataType dataType = columnSchema.getDataType(); if (dataType == DataTypes.SHORT) { value = new String(defaultValue, Charset.forName(CarbonCommonConstants.DEFAULT_CHARSET)); measureDefaultValue = new Short(value); } else if (dataType == DataTypes.LONG) { value = new String(defaultValue, Charset.forName(CarbonCommonConstants.DEFAULT_CHARSET)); measureDefaultValue = Long.parseLong(value); } else if (dataType == DataTypes.INT) { value = new String(defaultValue, Charset.forName(CarbonCommonConstants.DEFAULT_CHARSET)); measureDefaultValue = Integer.parseInt(value); } else if (DataTypes.isDecimal(dataType)) { BigDecimal decimal = DataTypeUtil.byteToBigDecimal(defaultValue); if (columnSchema.getScale() > decimal.scale()) { decimal = decimal.setScale(columnSchema.getScale(), RoundingMode.HALF_UP); } measureDefaultValue = decimal; } else { value = new String(defaultValue, Charset.forName(CarbonCommonConstants.DEFAULT_CHARSET)); Double parsedValue = Double.valueOf(value); if (!Double.isInfinite(parsedValue) && !Double.isNaN(parsedValue)) { measureDefaultValue = parsedValue; } } } return measureDefaultValue; } please review i corrected it --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1795 Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1662/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1795 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2896/ --- |
In reply to this post by qiuchenjian-2
Github user anubhav100 commented on the issue:
https://github.com/apache/carbondata/pull/1795 retest this please --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1795 Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1672/ --- |
In reply to this post by qiuchenjian-2
Github user anubhav100 commented on the issue:
https://github.com/apache/carbondata/pull/1795 retest this please --- |
In reply to this post by qiuchenjian-2
Github user anubhav100 commented on the issue:
https://github.com/apache/carbondata/pull/1795 retest this please --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1795 Build Failed with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2904/ --- |
In reply to this post by qiuchenjian-2
Github user anubhav100 commented on the issue:
https://github.com/apache/carbondata/pull/1795 retest this please --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1795 Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1676/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1795 Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2909/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1795 Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1681/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1795 Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2914/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1795 Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1688/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1795 Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/2921/ --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/1795 SDV Build Fail , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2963/ --- |
In reply to this post by qiuchenjian-2
Github user anubhav100 commented on the issue:
https://github.com/apache/carbondata/pull/1795 retest sdv please --- |
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/1795 SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/2970/ --- |
Free forum by Nabble | Edit this page |