KanakaKumar commented on a change in pull request #3262: [CARBONDATA-3415] 
Merge index is not working for partition table. Merge index for partition table 
is taking significantly longer time than normal table.
URL: https://github.com/apache/carbondata/pull/3262#discussion_r291638911
 
 

 ##########
 File path: 
core/src/main/java/org/apache/carbondata/core/metadata/SegmentFileStore.java
 ##########
 @@ -108,10 +129,19 @@ public static void writeSegmentFile(String tablePath, 
final String taskNo, Strin
         folderDetails.setPartitions(partionNames);
         folderDetails.setStatus(SegmentStatus.SUCCESS.getMessage());
         for (CarbonFile file : carbonFiles) {
-          folderDetails.getFiles().add(file.getName());
+          if (file.getName().endsWith(CarbonTablePath.MERGE_INDEX_FILE_EXT)) {
+            folderDetails.setMergeFileName(file.getName());
+          } else {
+            folderDetails.getFiles().add(file.getName());
+          }
         }
         segmentFile.addPath(location, folderDetails);
-        String path = writePath + "/" + taskNo + CarbonTablePath.SEGMENT_EXT;
+        String path = null;
+        if (isMergeIndexFlow) {
+          path = writePath + "/" + System.currentTimeMillis() + 
CarbonTablePath.SEGMENT_EXT;
 
 Review comment:
    System.currentTimeMillis() may overlap for multiple partitions executing 
concurrently.
   Please use taskno & combination of partition to construct the file name

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to