Github user ajantha-bhat commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/3041#discussion_r244686891
--- Diff:
integration/presto/src/main/java/org/apache/carbondata/presto/impl/CarbonTableReader.java
---
@@ -134,23 +127,17 @@
*/
public CarbonTableCacheModel getCarbonCache(SchemaTableName table,
String location,
Configuration config) {
- if (!carbonCache.get().containsKey(table) ||
carbonCache.get().get(table) == null) {
- updateSchemaTables(table, config);
- parseCarbonMetadata(table, location, config);
- }
- if (carbonCache.get().containsKey(table)) {
- return carbonCache.get().get(table);
- } else {
- return null;
+ updateSchemaTables(table, config);
+ CarbonTableCacheModel carbonTableCacheModel =
carbonCache.get().get(table);
+ if (carbonTableCacheModel == null || !carbonTableCacheModel.isValid())
{
+ return parseCarbonMetadata(table, location, config);
}
+ return carbonTableCacheModel;
}
private void removeTableFromCache(SchemaTableName table) {
--- End diff --
removeTableFromCache, is not removing any table from cache. Need to remove
here or rename the method ?
---