vikramahuja1001 commented on a change in pull request #3873:
URL: https://github.com/apache/carbondata/pull/3873#discussion_r478837180



##########
File path: 
integration/spark/src/main/scala/org/apache/spark/sql/index/CarbonIndexUtil.scala
##########
@@ -377,4 +381,212 @@ object CarbonIndexUtil {
       AlterTableUtil.releaseLocks(locks.asScala.toList)
     }
   }
+
+  def processSIRepair(indexTableName: String, carbonTable: CarbonTable,
+    carbonLoadModel: CarbonLoadModel, indexMetadata: IndexMetadata,
+      mainTableDetails: List[LoadMetadataDetails], secondaryIndexProvider: 
String)
+  (sparkSession: SparkSession) : Unit = {
+    val sparkSession = SparkSession.getActiveSession.get
+    // val databaseName = sparkSession.catalog.currentDatabase
+    // when Si creation and load to main table are parallel, get the 
carbonTable from the
+    // metastore which will have the latest index Info
+    val metaStore = CarbonEnv.getInstance(sparkSession).carbonMetaStore
+    val indexTable = metaStore
+      .lookupRelation(Some(carbonLoadModel.getDatabaseName), indexTableName)(
+        sparkSession)
+      .asInstanceOf[CarbonRelation]
+      .carbonTable
+
+    val mainTblLoadMetadataDetails: Array[LoadMetadataDetails] =
+      SegmentStatusManager.readLoadMetadata(carbonTable.getMetadataPath)

Review comment:
       added it from the caller




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to