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

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

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

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

 ##########
 File path: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/cache/CarbonDropCacheCommand.scala
 ##########
 @@ -47,57 +48,35 @@ case class CarbonDropCacheCommand(tableIdentifier: TableIdentifier, internalCall
   def clearCache(carbonTable: CarbonTable, sparkSession: SparkSession): Unit = {
     LOGGER.info("Drop cache request received for table " + carbonTable.getTableName)
 
-    val dropCacheEvent = DropCacheEvent(
-      carbonTable,
-      sparkSession,
-      internalCall
-    )
+    val dropCacheEvent = DropCacheEvent(carbonTable, sparkSession, internalCall)
     val operationContext = new OperationContext
     OperationListenerBus.getInstance.fireEvent(dropCacheEvent, operationContext)
 
     val cache = CacheProvider.getInstance().getCarbonCache
     if (cache != null) {
-      val tablePath = carbonTable.getTablePath + CarbonCommonConstants.FILE_SEPARATOR
-
-      // Dictionary IDs
-      val dictIds = carbonTable.getAllDimensions.asScala.filter(_.isGlobalDictionaryEncoding)
-        .map(_.getColumnId).toArray
+      // Index files
+      val allIndexFiles = CacheUtil.getAllIndexFiles(carbonTable)
+
+      // Dictionary entries
+      val dictIDs: List[String] = carbonTable.getAllDimensions.asScala
+        .filter(_.isGlobalDictionaryEncoding)
+        .map(_.getColumnId).toList
+      val dictKeys: List[String] =
+        dictIDs.map {
+          dictID =>
+            CacheUtil.getLruCacheKey(dictID, CacheType.FORWARD_DICTIONARY)
+        } ++
+        dictIDs.map {
+          dictID =>
+            CacheUtil.getLruCacheKey(dictID, CacheType.REVERSE_DICTIONARY)
+        }
 
 Review comment:
   Both these loops can be combined with the previous loop

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