kunal642 commented on a change in pull request #3565: [CARBONDATA-3662]: 
Changes to show metacache command
URL: https://github.com/apache/carbondata/pull/3565#discussion_r367232863
 
 

 ##########
 File path: 
integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/cache/CarbonShowCacheCommand.scala
 ##########
 @@ -169,41 +224,32 @@ case class CarbonShowCacheCommand(tableIdentifier: 
Option[TableIdentifier],
       }
       val (driverIndexSize, driverDatamapSize, allDictSize) = 
getAllDriverCacheSize(tablePaths
         .toList)
-      if (driverRows.nonEmpty) {
+      if (driverIndexSize + driverDatamapSize + allDictSize != 0 && 
driverRows.size!=0) {
         (Seq(
-          Row("ALL", "ALL", driverIndexSize, driverDatamapSize, allDictSize, 
"DRIVER"),
-          Row(currentDatabase,
-            "ALL",
-            driverdbIndexSize,
-            driverdbDatamapSize,
-            driverdbDictSize,
-            "DRIVER")
+          Row("TOTAL", driverIndexSize, driverDatamapSize, allDictSize, 
"DRIVER")
         ) ++ driverRows).collect {
-          case row if row.getLong(2) != 0L || row.getLong(3) != 0L || 
row.getLong(4) != 0L =>
-            Row(row(0), row(1), bytesToDisplaySize(row.getLong(2)),
-              bytesToDisplaySize(row.getLong(3)), 
bytesToDisplaySize(row.getLong(4)), "DRIVER")
+          case row if row.getLong(1) != 0L || row.getLong(2) != 0L || 
row.getLong(3) != 0L =>
+            Row(row(0), bytesToDisplaySize(row.getLong(1)),
+              bytesToDisplaySize(row.getLong(2)), 
bytesToDisplaySize(row.getLong(3)), "DRIVER")
         }
       } else {
-        makeEmptyCacheRows(currentDatabase)
+        Seq()
       }
     } else {
-      makeEmptyCacheRows(currentDatabase)
+      Seq()
     }
 
-    //      val (serverIndexSize, serverDataMapSize) = 
getAllIndexServerCacheSize
-    val indexDisplayRows = if (indexServerRows.nonEmpty) {
+    val indexDisplayRows = if (indexAllIndexSize + indexAllDatamapSize != 0 &&
+                               indexServerRows.size != 0) {
       (Seq(
-        Row("ALL", "ALL", indexAllIndexSize, indexAllDatamapSize, 
indexAllDictSize, "INDEX SERVER"),
-        Row(currentDatabase,
-          "ALL",
-          indexdbIndexSize,
-          indexdbDatamapSize,
-          driverdbDictSize,
-          "INDEX SERVER")
+        Row("TOTAL", indexAllIndexSize, indexAllDatamapSize, indexAllDictSize, 
"INDEX SERVER")
       ) ++ indexServerRows).collect {
-        case row if row.getLong(2) != 0L || row.getLong(3) != 0L || 
row.getLong(4) != 0L =>
-          Row(row.get(0), row.get(1), bytesToDisplaySize(row.getLong(2)),
-            bytesToDisplaySize(row.getLong(3)), 
bytesToDisplaySize(row.getLong(4)), "INDEX SERVER")
+        case row if row.getLong(1) != 0L || row.getLong(2) != 0L || 
row.getLong(3) != 0L =>
+          Row(row.get(0),
+            bytesToDisplaySize(row.getLong(1)),
+            bytesToDisplaySize(row.getLong(2)),
 
 Review comment:
   revert this

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


With regards,
Apache Git Services

Reply via email to