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



##########
File path: 
integration/spark/src/main/scala/org/apache/spark/sql/execution/command/index/CarbonCreateIndexCommand.scala
##########
@@ -238,11 +238,22 @@ case class CarbonCreateIndexCommand(
               false)
             val enabledIndexInfo = IndexTableInfo.enableIndex(indexInfo, 
indexModel.indexName)
 
-            // set index information in parent table
-            val parentIndexMetadata = parentTable.getIndexMetadata
-            parentIndexMetadata.updateIndexStatus(indexProviderName,
-              indexModel.indexName,
-              IndexStatus.ENABLED.name())
+            // set index information in parent table. Create it if it is null.
+            val parentIndexMetadata = if (
+              parentTable.getTableInfo.getFactTable.getTableProperties
+                .get(parentTable.getCarbonTableIdentifier.getTableId) != null) 
{

Review comment:
       in the case when the whole flow goes to fallback mode in the index 
server, the parent table retrieved again in the processData function does not 
contain the serialized IndexMetaData. 




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