[GitHub] [carbondata] NamanRastogi commented on a change in pull request #3146: [WIP] Added PreAgg Event Listener for ShowCacheCommmand

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

[GitHub] [carbondata] NamanRastogi commented on a change in pull request #3146: [WIP] Added PreAgg Event Listener for ShowCacheCommmand

GitBox
NamanRastogi commented on a change in pull request #3146: [WIP]  Added PreAgg Event Listener for ShowCacheCommmand
URL: https://github.com/apache/carbondata/pull/3146#discussion_r265411151
 
 

 ##########
 File path: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/cache/CarbonDropCacheCommand.scala
 ##########
 @@ -63,41 +63,32 @@ case class CarbonDropCacheCommand(tableIdentifier: TableIdentifier, internalCall
       val dictIds = carbonTable.getAllDimensions.asScala.filter(_.isGlobalDictionaryEncoding)
         .map(_.getColumnId).toArray
 
-      // Remove elements from cache
-      val keysToRemove = ListBuffer[String]()
-      val cacheIterator = cache.getCacheMap.entrySet().iterator()
-      while (cacheIterator.hasNext) {
-        val entry = cacheIterator.next()
-        val cache = entry.getValue
-
-        if (cache.isInstanceOf[BlockletDataMapIndexWrapper]) {
-          // index
-          val indexPath = entry.getKey.replace(CarbonCommonConstants.WINDOWS_FILE_SEPARATOR,
-            CarbonCommonConstants.FILE_SEPARATOR)
-          if (indexPath.startsWith(tablePath)) {
-            keysToRemove += entry.getKey
-          }
-        } else if (cache.isInstanceOf[BloomCacheKeyValue.CacheValue]) {
-          // bloom datamap
-          val shardPath = entry.getKey.replace(CarbonCommonConstants.WINDOWS_FILE_SEPARATOR,
-            CarbonCommonConstants.FILE_SEPARATOR)
-          if (shardPath.contains(tablePath)) {
-            keysToRemove += entry.getKey
-          }
-        } else if (cache.isInstanceOf[AbstractColumnDictionaryInfo]) {
-          // dictionary
-          val dictId = dictIds.find(id => entry.getKey.startsWith(id))
-          if (dictId.isDefined) {
-            keysToRemove += entry.getKey
-          }
+      def checkIfValid(key: String, cacheable: Cacheable): Boolean = {
 
 Review comment:
   Done

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