[GitHub] [carbondata] ajantha-bhat commented on a change in pull request #3493: [CARBONDATA-3600] Fix creating mv timeseries UDF column as partition column

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] ajantha-bhat commented on a change in pull request #3493: [CARBONDATA-3600] Fix creating mv timeseries UDF column as partition column

GitBox
ajantha-bhat commented on a change in pull request #3493: [CARBONDATA-3600] Fix creating mv timeseries UDF column as partition column
URL: https://github.com/apache/carbondata/pull/3493#discussion_r356934421
 
 

 ##########
 File path: datamap/mv/core/src/main/scala/org/apache/carbondata/mv/datamap/MVDataMapProvider.scala
 ##########
 @@ -95,8 +95,11 @@ class MVDataMapProvider(
       dataMapSchema.getRelationIdentifier.getTableName,
       true)
     dropTableCommand.processMetadata(sparkSession)
-    DataMapStoreManager.getInstance.unRegisterDataMapCatalog(dataMapSchema)
+    // First, drop datamapschema and unregister datamap from catalog, because if in
+    // case, unregister fails, datamapschema will not be deleted from system and cannot
+    // create datamap also again
     DataMapStoreManager.getInstance().dropDataMapSchema(dataMapSchema.getDataMapName)
+    DataMapStoreManager.getInstance.unRegisterDataMapCatalog(dataMapSchema)
 
 Review comment:
   Now If dropDataMapSchema throws exception, unregister will not happen.
   better to keep dropDataMapSchema in try catch and unRegisterDataMapCatalog in finally block

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


With regards,
Apache Git Services