You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by GitBox <gi...@apache.org> on 2020/10/16 05:47:50 UTC
[GitHub] [carbondata] ajantha-bhat commented on a change in pull request #3985: [CARBONDATA-3965]Fixed float variable target datatype in case of adaptive encoding
ajantha-bhat commented on a change in pull request #3985:
URL: https://github.com/apache/carbondata/pull/3985#discussion_r506065671
##########
File path: core/src/main/java/org/apache/carbondata/core/datastore/page/statistics/PrimitivePageStatsCollector.java
##########
@@ -256,7 +256,7 @@ private int getDecimalCount(double value) {
}
private int getDecimalCount(float value) {
- return getDecimalCount((double) value);
+ return getDecimalCount(Double.parseDouble(Float.toString(value)));
Review comment:
In `AdaptiveDeltaFloatingCodec.java` line please remove line 323 to 328. As this code is added as a cover up to this issue.
```
} else if (pageDataType == DataTypes.LONG) {
int size = pageSize * longSizeInBytes;
for (int i = 0; i < size; i += longSizeInBytes) {
vector.putDouble(rowId++, (max - ByteUtil.toLongLittleEndian(pageData, i)) / factor);
}
}
```
Similarly in `AdaptiveFloatingCodec` 309 to 313
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org