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



##########
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) 
{
+              val tempIndexMetaData = parentTable.getIndexMetadata
+              tempIndexMetaData.updateIndexStatus(indexProviderName,

Review comment:
       done, please check again!




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