Login  Register

[GitHub] [carbondata] ajantha-bhat commented on a change in pull request #4073: [CARBONDATA-4104] Vector filling for complex decimal type needs to be handled

Posted by GitBox on Jan 29, 2021; 5:53am
URL: http://apache-carbondata-dev-mailing-list-archive.168.s1.nabble.com/GitHub-carbondata-akkio-97-opened-a-new-pull-request-4073-WIP-tp105327p105762.html


ajantha-bhat commented on a change in pull request #4073:
URL: https://github.com/apache/carbondata/pull/4073#discussion_r566594717



##########
File path: core/src/main/java/org/apache/carbondata/core/metadata/datatype/DecimalConverterFactory.java
##########
@@ -324,33 +311,6 @@ public BigDecimal getDecimal(Object valueToBeConverted) {
       return new BigDecimal(bigInteger, scale);
     }
 
-    @Override
-    public void fillVector(Object valuesToBeConverted, int size,
-        ColumnVectorInfo vectorInfo, BitSet nullBitSet, DataType pageType) {
-      CarbonColumnVector vector = getCarbonColumnVector(vectorInfo, nullBitSet);
-      //TODO handle complex child
-      int precision = vectorInfo.measure.getMeasure().getPrecision();
-      int newMeasureScale = vectorInfo.measure.getMeasure().getScale();
-      if (scale < newMeasureScale) {
-        scale = newMeasureScale;
-      }
-      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]);
-            BigDecimal value = new BigDecimal(bigInteger, scale);
-            if (value.scale() < newMeasureScale) {
-              value = value.setScale(newMeasureScale);
-            }
-            vector.putDecimal(i, value, precision);
-          }
-        }
-      }

Review comment:
       add an else check and call the super.fillvector if it is not byte[][], instead of copying this code in super class and changing its implementation. super class was meant only for one dimensional byte[]




----------------------------------------------------------------
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:
[hidden email]