Github user ravipesala commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2819#discussion_r226832821
--- Diff:
core/src/main/java/org/apache/carbondata/core/metadata/datatype/DecimalConverterFactory.java
---
@@ -173,6 +221,23 @@ public int getSizeInBytes() {
return new BigDecimal(bigInteger, scale);
}
+ @Override public void fillVector(Object valuesToBeConverted, int size,
ColumnVectorInfo info,
+ BitSet nullBitset) {
+ CarbonColumnVector vector = info.vector;
+ int precision = info.measure.getMeasure().getPrecision();
+ if (valuesToBeConverted instanceof byte[][]) {
+ byte[][] data = (byte[][]) valuesToBeConverted;
+ for (int i = 0; i < size; i++) {
+ if (nullBitset.get(i)) {
+ vector.putNull(i);
+ } else {
+ BigInteger bigInteger = new BigInteger(data[i]);
+ vector.putDecimal(i, new BigDecimal(bigInteger, scale),
precision);
--- End diff --
The method `DataTypeUtil.byteToBigDecimal(data[i]), precision)` is
different as it calculates scale also from binary, but here we no need of it.
---