jackylk commented on a change in pull request #3642: [CARBONDATA-3725]fix 
concurrent creation of Materialized Views issue
URL: https://github.com/apache/carbondata/pull/3642#discussion_r385988813
 
 

 ##########
 File path: 
mv/core/src/main/scala/org/apache/carbondata/mv/rewrite/SummaryDatasetCatalog.scala
 ##########
 @@ -107,12 +110,19 @@ private[mv] class SummaryDatasetCatalog(sparkSession: 
SparkSession)
       // catalog, if the datamap is in database other than 
sparkSession.currentDataBase(), then it
       // fails to register, so set the database present in the dataMapSchema 
Object
       setCurrentDataBase(dataMapSchema.getRelationIdentifier.getDatabaseName)
-      val mvPlan = MVParser.getMVPlan(dataMapSchema.getCtasQuery, sparkSession)
-      // here setting back to current database of current session, because if 
the actual query
-      // contains db name in query like, select db1.column1 from table and 
current database is
-      // default and if we drop the db1, still the session has current db as 
db1.
-      // So setting back to current database.
-      setCurrentDataBase(currentDatabase)
+      val mvPlan = try {
+        MVParser.getMVPlan(dataMapSchema.getCtasQuery, sparkSession)
+      } catch {
+        case ex: Exception =>
+          LOGGER.error("Error executing the updated query during register 
datamap schema", ex)
 
 Review comment:
   ```suggestion
             LOGGER.error("Error executing the updated query during register MV 
schema", ex)
   ```

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


With regards,
Apache Git Services

Reply via email to