[GitHub] dhatchayani commented on a change in pull request #3126: [CARBONDATA-3293] Prune datamaps improvement

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] dhatchayani commented on a change in pull request #3126: [CARBONDATA-3293] Prune datamaps improvement

GitBox
dhatchayani commented on a change in pull request #3126: [CARBONDATA-3293] Prune datamaps improvement
URL: https://github.com/apache/carbondata/pull/3126#discussion_r258854287
 
 

 ##########
 File path: core/src/main/java/org/apache/carbondata/core/indexstore/UnsafeMemoryDMStore.java
 ##########
 @@ -94,87 +101,110 @@ public void addIndexRow(CarbonRowSchema[] schema, DataMapRow indexRow) throws Me
     // Check whether allocated memory is sufficient or not.
     ensureSize(rowSize);
     int pointer = runningLength;
-
+    List<Object> dataPos = new ArrayList<>();
     for (int i = 0; i < schema.length; i++) {
-      addToUnsafe(schema[i], indexRow, i);
+      addToUnsafe(schema[i], indexRow, i, dataPos);
     }
+    dataPosition.put(rowCount, dataPos);
     pointers[rowCount++] = pointer;
   }
 
-  private void addToUnsafe(CarbonRowSchema schema, DataMapRow row, int index) {
+  private void addToUnsafe(CarbonRowSchema schema, DataMapRow row, int index,
+      List<Object> dataPos) {
     switch (schema.getSchemaType()) {
       case FIXED:
         DataType dataType = schema.getDataType();
         if (dataType == DataTypes.BYTE) {
           getUnsafe()
               .putByte(memoryBlock.getBaseObject(), memoryBlock.getBaseOffset() + runningLength,
                   row.getByte(index));
-          runningLength += row.getSizeInBytes(index);
+          int sizeInBytes = row.getSizeInBytes(index);
 
 Review comment:
   @ravipesala attached performance report in the description. please check

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services