ravipesala commented on a change in pull request #3164: [WIP] [CARBONDATA-3331]
Fix for external table in Show Metacache
URL: https://github.com/apache/carbondata/pull/3164#discussion_r269880107
##########
File path:
integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/cache/CarbonShowCacheCommand.scala
##########
@@ -71,52 +65,64 @@ case class CarbonShowCacheCommand(tableIdentifier:
Option[TableIdentifier],
Row("ALL", "ALL", 0L, 0L, 0L),
Row(currentDatabase, "ALL", 0L, 0L, 0L))
} else {
- val carbonTables = CarbonEnv.getInstance(sparkSession).carbonMetaStore
- .listAllTables(sparkSession).filter {
- carbonTable =>
- carbonTable.getDatabaseName.equalsIgnoreCase(currentDatabase) &&
- isValidTable(carbonTable, sparkSession) &&
- !carbonTable.isChildDataMap
+ val carbonTables =
sparkSession.sessionState.catalog.listTables(currentDatabase).collect {
+ case tableIdent if CarbonEnv.getInstance(sparkSession).carbonMetaStore
+ .tableExists(tableIdent)(sparkSession) =>
+ CarbonEnv.getCarbonTable(tableIdent)(sparkSession)
Review comment:
Its a two time lookup, instead directly call
`CarbonEnv.getCarbonTable(tableIdent)(sparkSession)` and catch the excetion and
ignore for non carbon tables
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services