[GitHub] [carbondata] ravipesala commented on a change in pull request #3355: [HOTFIX] Improve select query after Update/Delete operation.

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

[GitHub] [carbondata] ravipesala commented on a change in pull request #3355: [HOTFIX] Improve select query after Update/Delete operation.

GitBox
ravipesala commented on a change in pull request #3355: [HOTFIX] Improve select query after Update/Delete operation.
URL: https://github.com/apache/carbondata/pull/3355#discussion_r344614820
 
 

 ##########
 File path: core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentUpdateStatusManager.java
 ##########
 @@ -348,50 +324,67 @@ public boolean isBlockValid(String segName, String blockName) {
           return deleteFileList;
         }
         final long deltaEndTimeStamp = getEndTimeOfDeltaFile(extension, block);
-
-        // final long deltaEndTimeStamp = block.getDeleteDeltaEndTimeAsLong();
-        // final long deltaStartTimestamp = block.getDeleteDeltaStartTimeAsLong();
-        return getFilePaths(blockDir, blockNameFromTuple, extension, deleteFileList,
-            deltaStartTimestamp, deltaEndTimeStamp);
+        // If start and end time is same then it has only one delta file so construct the file
+        // directly with available information with out listing
+        if (block.getDeleteDeltaStartTimestamp().equals(block.getDeleteDeltaEndTimestamp())) {
+          deleteFileList.add(
+              blockDir + CarbonCommonConstants.FILE_SEPARATOR + block.getBlockName() + "-" + block
+                  .getDeleteDeltaStartTimestamp() + extension);
+          // If deltatimestamps list has data then it has multiple delta file so construct the file
+          // directly with list of deltas with out listing
+        } else if (block.getDeltaFileStamps() != null && block.getDeltaFileStamps().size() > 0) {
+          for (String delta : block.getDeltaFileStamps()) {
+            deleteFileList.add(
+                blockDir + CarbonCommonConstants.FILE_SEPARATOR + block.getBlockName() + "-" + delta
 
 Review comment:
   Ok, For better performance and memory utilization StringBuilder is better for simple concatenation. So I used StringBuilder.

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


With regards,
Apache Git Services