[GitHub] [carbondata] ravipesala commented on a change in pull request #3339: [CARBONDATA-3480] Fixed unnecessary refresh for table by removing modified mdt file

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

[GitHub] [carbondata] ravipesala commented on a change in pull request #3339: [CARBONDATA-3480] Fixed unnecessary refresh for table by removing modified mdt file

GitBox
ravipesala commented on a change in pull request #3339: [CARBONDATA-3480] Fixed unnecessary refresh for table by removing modified mdt file
URL: https://github.com/apache/carbondata/pull/3339#discussion_r309266543
 
 

 ##########
 File path: integration/spark2/src/main/scala/org/apache/spark/sql/hive/CarbonFileMetastore.scala
 ##########
 @@ -417,59 +396,30 @@ class CarbonFileMetastore extends CarbonMetaStore {
     thriftWriter.open(FileWriteOperation.OVERWRITE)
     thriftWriter.write(thriftTableInfo)
     thriftWriter.close()
-    updateSchemasUpdatedTime(touchSchemaFileSystemTime())
+    updateSchemasUpdatedTime(thriftTableInfo.getFact_table.getTable_id, thriftTableInfo
+      .getFact_table.getSchema_evolution.schema_evolution_history.get(0).time_stamp)
     identifier.getTablePath
   }
 
-  protected def addTableCache(
+  protected def addCarbonTableToCache(
       tableInfo: table.TableInfo,
-      absoluteTableIdentifier: AbsoluteTableIdentifier): ArrayBuffer[CarbonTable] = {
+      absoluteTableIdentifier: AbsoluteTableIdentifier): Unit = {
     val identifier = absoluteTableIdentifier.getCarbonTableIdentifier
     CarbonMetadata.getInstance.removeTable(tableInfo.getTableUniqueName)
     removeTableFromMetadata(identifier.getDatabaseName, identifier.getTableName)
     CarbonMetadata.getInstance().loadTableMetadata(tableInfo)
-    metadata.writeLock.lock()
-    metadata.carbonTables +=
-      CarbonMetadata.getInstance().getCarbonTable(identifier.getTableUniqueName)
-    metadata.writeLock.unlock()
-    metadata.carbonTables
   }
 
   /**
-   * This method will remove the table meta from catalog metadata array
-   *
-   * @param dbName
-   * @param tableName
+   * This method will remove the table meta from CarbonMetadata cache.
    */
   def removeTableFromMetadata(dbName: String, tableName: String): Unit = {
-    val carbonTableToBeRemoved: Option[CarbonTable] = getTableFromMetadataCache(dbName, tableName)
-    carbonTableToBeRemoved match {
-      case Some(carbonTable) =>
-        metadata.writeLock.lock()
-        metadata.carbonTables -= carbonTable
-        metadata.writeLock.unlock()
-      case None =>
-        if (LOGGER.isDebugEnabled) {
-          LOGGER.debug(s"No entry for table $tableName in database $dbName")
-        }
-    }
     CarbonMetadata.getInstance.removeTable(dbName, tableName)
   }
 
   private def updateMetadataByWrapperTable(
 
 Review comment:
   This method looks redundant, we can call` addCarbonTableToCache` instead of it.

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