You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by GitBox <gi...@apache.org> on 2019/03/09 08:53:43 UTC

[GitHub] [carbondata] qiuchenjian commented on a change in pull request #3141: [CARBONDATA-3310]fix IndexOutOfBoundException when drop table and create table run parallel for different table

qiuchenjian commented on a change in pull request #3141: [CARBONDATA-3310]fix IndexOutOfBoundException when drop table and create table run parallel for different table
URL: https://github.com/apache/carbondata/pull/3141#discussion_r263992050
 
 

 ##########
 File path: integration/spark2/src/main/scala/org/apache/spark/sql/hive/CarbonFileMetastore.scala
 ##########
 @@ -424,16 +436,21 @@ class CarbonFileMetastore extends CarbonMetaStore {
    * @param tableName
    */
   def removeTableFromMetadata(dbName: String, tableName: String): Unit = {
-    val carbonTableToBeRemoved: Option[CarbonTable] = getTableFromMetadataCache(dbName, tableName)
-    carbonTableToBeRemoved match {
-      case Some(carbonTable) =>
-        metadata.carbonTables -= carbonTable
-      case None =>
-        if (LOGGER.isDebugEnabled) {
-          LOGGER.debug(s"No entry for table $tableName in database $dbName")
-        }
+    if (isDropAllowed) {
+      val carbonTableToBeRemoved: Option[CarbonTable] = getTableFromMetadataCache(dbName, tableName)
+      carbonTableToBeRemoved match {
+        case Some(carbonTable) =>
+          metadata.carbonTables -= carbonTable
+        case None =>
+          if (LOGGER.isDebugEnabled) {
+            LOGGER.debug(s"No entry for table $tableName in database $dbName")
+          }
+      }
+      CarbonMetadata.getInstance.removeTable(dbName, tableName)
+    } else {
+      Thread.sleep(250)
 
 Review comment:
   Better to add timeout

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


With regards,
Apache Git Services