You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@carbondata.apache.org by ku...@apache.org on 2019/06/26 13:44:14 UTC
[carbondata] branch master updated: [CARBONDATA-3435]
Show-Metacache behaviour change
This is an automated email from the ASF dual-hosted git repository.
kunalkapoor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/carbondata.git
The following commit(s) were added to refs/heads/master by this push:
new 473afdd [CARBONDATA-3435] Show-Metacache behaviour change
473afdd is described below
commit 473afdd34d16a86acaaeb554c6e42ade6b8adfc1
Author: namanrastogi <na...@gmail.com>
AuthorDate: Thu Jun 13 19:35:42 2019 +0530
[CARBONDATA-3435] Show-Metacache behaviour change
Behaviour of SHOW METACACHE ON TABLE tblName is not same for Driver
and Index-Server. Need same behavior for both.
Old behaviour: Show all the entries for all the child tables,
even if the size is zero.
New behaviour: Don't show any entry with size 0 in both Driver and Index-Server.
This closes #3286
---
.../command/cache/CarbonShowCacheCommand.scala | 25 ++++++++++++++++------
1 file changed, 18 insertions(+), 7 deletions(-)
diff --git a/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/cache/CarbonShowCacheCommand.scala b/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/cache/CarbonShowCacheCommand.scala
index 795c063..b766cec 100644
--- a/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/cache/CarbonShowCacheCommand.scala
+++ b/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/cache/CarbonShowCacheCommand.scala
@@ -238,12 +238,14 @@ case class CarbonShowCacheCommand(tableIdentifier: Option[TableIdentifier],
val dbName = tableArray(0)
val tableName = tableArray(1)
val childMetaCacheInfo = collectDriverMetaCacheInfo(s"${dbName}_$tableName")
- childMetaCacheInfo.map {
- childMeta => Row(childMeta._1, childMeta._3, 0L, childTable._2)
+ childMetaCacheInfo.collect {
+ case childMeta if childMeta._3 != 0 =>
+ Row(childMeta._1, childMeta._3, 0L, childTable._2)
}
- } ++ (dataMapCacheInfo.map {
- childMeta => Row(childMeta._1, childMeta._3, 0L, childMeta._4)
- })
+ } ++ dataMapCacheInfo.collect {
+ case childMeta if childMeta._3 != 0 =>
+ Row(childMeta._1, childMeta._3, 0L, childMeta._4)
+ }
var comments = parentMetaCacheInfo._2 + s"/$numOfIndexFiles index files cached"
if (!carbonTable.isTransactionalTable) {
comments += " (external table)"
@@ -307,10 +309,19 @@ case class CarbonShowCacheCommand(tableIdentifier: Option[TableIdentifier],
val tableName = childTable._1.replace("-", "_")
if (childTable._2
.equalsIgnoreCase(DataMapClassProvider.BLOOMFILTER.getShortName)) {
- Seq(Row(tableName, 0L, getTableCache(cache, tableName)._2, childTable._2))
+ val childCache = getTableCache(cache, tableName)._2
+ if (childCache != 0) {
+ Seq(Row(tableName, 0L, childCache, childTable._2))
+ } else {
+ Seq.empty
+ }
} else {
val childCache = getTableCache(cache, tableName)._2
- Seq(Row(tableName, childCache, 0L, childTable._2))
+ if (childCache != 0) {
+ Seq(Row(tableName, childCache, 0L, childTable._2))
+ } else {
+ Seq.empty
+ }
}
}
var comments = mainTableFiles + s"/$numberOfIndexFiles index files cached"