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



##########
File path: 
integration/spark/src/main/scala/org/apache/spark/sql/secondaryindex/util/SecondaryIndexUtil.scala
##########
@@ -231,73 +240,36 @@ object SecondaryIndexUtil {
           } else {
             siRebuildRDD.partitions.foreach { partition =>
               val carbonSparkPartition = 
partition.asInstanceOf[CarbonSparkPartition]
-              deleteOldCarbonDataFiles(carbonSparkPartition)
+              deleteOldCarbonDataFiles(carbonSparkPartition, 
validSegmentsToUse.toList)
             }
           }
+          val segmentToLoadStartTimeMap: scala.collection.mutable.Map[String, 
java.lang.Long] =
+            scala.collection.mutable.Map()
+          // merge index files and write segment file for merged segments
           mergedSegments.asScala.map { seg =>
+            val segmentPath = CarbonTablePath.getSegmentPath(tablePath, 
seg.getLoadName)
+            try {
+              new CarbonIndexFileMergeWriter(indexCarbonTable)
+                .writeMergeIndexFileBasedOnSegmentFolder(null, false, 
segmentPath,
+                  seg.getLoadName, carbonLoadModel.getFactTimeStamp.toString,
+                  true)
+            } catch {
+              case e: IOException =>
+                val message =
+                  s"Failed to merge index files in path: $segmentPath. " + 
e.getMessage()

Review comment:
       ```suggestion
                     s"Failed to merge index files in path: $segmentPath. 
${e.getMessage()} "
   ```




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


Reply via email to