carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chenliang...@apache.org
Subject carbondata git commit: [CARBONDATA-1832] Table cache should be cleared when dropping table
Date Wed, 29 Nov 2017 14:25:29 GMT
Repository: carbondata
Updated Branches:
  refs/heads/master 06473484b -> f2dcb6d87


[CARBONDATA-1832] Table cache should be cleared when dropping table

Table cache should be cleared when dropping table. This PR drop the index and dictionary cache
in drive side.

This closes #1585


Project: http://git-wip-us.apache.org/repos/asf/carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/carbondata/commit/f2dcb6d8
Tree: http://git-wip-us.apache.org/repos/asf/carbondata/tree/f2dcb6d8
Diff: http://git-wip-us.apache.org/repos/asf/carbondata/diff/f2dcb6d8

Branch: refs/heads/master
Commit: f2dcb6d87053a1d38b4b0680acd4bd9d9c6211a6
Parents: 0647348
Author: Jacky Li <jacky.likun@qq.com>
Authored: Wed Nov 29 13:39:21 2017 +0800
Committer: chenliang613 <chenliang613@huawei.com>
Committed: Wed Nov 29 22:25:10 2017 +0800

----------------------------------------------------------------------
 .../sql/execution/command/table/CarbonDropTableCommand.scala | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/f2dcb6d8/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonDropTableCommand.scala
----------------------------------------------------------------------
diff --git a/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonDropTableCommand.scala
b/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonDropTableCommand.scala
index a3486a2..9ec738c 100644
--- a/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonDropTableCommand.scala
+++ b/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonDropTableCommand.scala
@@ -27,10 +27,11 @@ import org.apache.spark.sql.hive.CarbonRelation
 import org.apache.spark.sql.util.CarbonException
 
 import org.apache.carbondata.common.logging.{LogService, LogServiceFactory}
+import org.apache.carbondata.core.cache.dictionary.ManageDictionaryAndBTree
 import org.apache.carbondata.core.constants.CarbonCommonConstants
 import org.apache.carbondata.core.datastore.impl.FileFactory
 import org.apache.carbondata.core.locks.{CarbonLockUtil, ICarbonLock, LockUsage}
-import org.apache.carbondata.core.metadata.AbsoluteTableIdentifier
+import org.apache.carbondata.core.metadata.{AbsoluteTableIdentifier, CarbonMetadata}
 import org.apache.carbondata.core.metadata.schema.table.CarbonTable
 import org.apache.carbondata.core.util.{CarbonProperties, CarbonUtil}
 import org.apache.carbondata.core.util.path.CarbonStorePath
@@ -130,6 +131,11 @@ case class CarbonDropTableCommand(
       CarbonProperties.getStorePath)
     val tablePath = databaseLocation + CarbonCommonConstants.FILE_SEPARATOR + tableName.toLowerCase
     val tableIdentifier = AbsoluteTableIdentifier.from(tablePath, dbName, tableName)
+    val carbonTable = CarbonMetadata.getInstance().getCarbonTable(dbName, tableName)
+    if (carbonTable != null) {
+      // clear driver side index and dictionary cache
+      ManageDictionaryAndBTree.clearBTreeAndDictionaryLRUCache(carbonTable)
+    }
     val metadataFilePath =
       CarbonStorePath.getCarbonTablePath(tableIdentifier).getMetadataDirectoryPath
     val fileType = FileFactory.getFileType(metadataFilePath)


Mime
View raw message