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



##########
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:
       We are updating the same variable inside for loop so scala is giving 
error as `Variable used in lambda expression should be final or effectively 
final`




-- 
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-unsubscr...@carbondata.apache.org

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


Reply via email to