You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@carbondata.apache.org by GitBox <gi...@apache.org> on 2021/09/30 13:19:44 UTC

[GitHub] [carbondata] akashrn5 commented on a change in pull request #4220: [CARBONDATA-4228] [CARBONDATA-4203] Fixed update/delete after alter add segment

akashrn5 commented on a change in pull request #4220:
URL: https://github.com/apache/carbondata/pull/4220#discussion_r719397599



##########
File path: core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentUpdateStatusManager.java
##########
@@ -366,17 +366,28 @@ public boolean accept(CarbonFile pathName) {
    */
   public List<String> getDeleteDeltaFilesList(final Segment segment, final String blockName) {
     List<String> deleteDeltaFileList = new ArrayList<>();
-    String segmentPath = CarbonTablePath.getSegmentPath(
-        identifier.getTablePath(), segment.getSegmentNo());
+    String segmentPath = null;
+    if (segment.isExternalSegment()) {
+      for (LoadMetadataDetails details : segmentDetails) {
+        if (details.getLoadName().equals(segment.getSegmentNo())) {
+          segmentPath = details.getPath();
+          break;
+        }
+      }
+    } else {
+      segmentPath = CarbonTablePath.getSegmentPath(
+              identifier.getTablePath(), segment.getSegmentNo());
+    }
 
     for (SegmentUpdateDetails block : updateDetails) {
       if ((block.getBlockName().equalsIgnoreCase(blockName)) &&
           (block.getSegmentName().equalsIgnoreCase(segment.getSegmentNo())) &&
           !CarbonUpdateUtil.isBlockInvalid(block.getSegmentStatus())) {
         Set<String> deltaFileTimestamps = block.getDeltaFileStamps();
         if (deltaFileTimestamps != null && deltaFileTimestamps.size() > 0) {
+          String finalSegmentPath = segmentPath;

Review comment:
       why one more variable is required?




-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@carbondata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org