kunal642 commented on a change in pull request #3837:
URL: https://github.com/apache/carbondata/pull/3837#discussion_r464843011



##########
File path: 
core/src/main/java/org/apache/carbondata/core/mutate/CarbonUpdateUtil.java
##########
@@ -952,10 +952,22 @@ public static String getSegmentBlockNameKey(String segID, 
String blockName,
     String blockNameWithOutPart = blockName
         .substring(blockName.indexOf(CarbonCommonConstants.HYPHEN) + 1,
             blockName.lastIndexOf(CarbonTablePath.getCarbonDataExtension()));
+    // to remove compressor name
+    int index = blockNameWithOutPart.lastIndexOf(CarbonCommonConstants.POINT);
     if (isPartitionTable) {
-      return blockNameWithOutPart;
+      if (index != -1) {
+        return 
blockNameWithOutPart.replace(blockNameWithOutPart.substring(index), "");
+      } else {
+        return blockNameWithOutPart;
+      }
+    }
+    if (index != -1) {
+      String blockNameWithoutCompressorName =
+          blockNameWithOutPart.replace(blockNameWithOutPart.substring(index), 
"");
+      return segID + CarbonCommonConstants.FILE_SEPARATOR + 
blockNameWithoutCompressorName;
+    } else {
+      return segID + CarbonCommonConstants.FILE_SEPARATOR + 
blockNameWithOutPart;

Review comment:
       Please add a unit test to validate this functionality




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to