illiabarbashov-sketch commented on code in PR #6961:
URL: https://github.com/apache/hive/pull/6961#discussion_r4666662437
##########
ql/src/java/org/apache/hadoop/hive/ql/metadata/SessionHiveMetaStoreClient.java:
##########
@@ -218,17 +229,34 @@ public Table getTable(GetTableRequest req) throws
TException {
tableId = (long) queryCache.get(cacheKeyTableId);
}
+ // a table missing from the metastore stays missing for the rest of the
compilation
+ CacheKey cacheKeyNotFound = tableNotFoundKey(req.getCatName(),
req.getDbName(), req.getTblName());
+ String notFound = (String) queryCache.get(cacheKeyNotFound);
+ if (notFound != null) {
+ LOG.debug("Query level HMS cache: method=getTable, table not found,
dbName={}, tblName={}",
+ req.getDbName(), req.getTblName());
+ throw new NoSuchObjectException(notFound);
+ }
+
req.setId(tableId);
CacheKey cacheKey = new CacheKey(KeyType.TABLE, req);
Table table = (Table) queryCache.get(cacheKey);
if (table == null) {
- table = delegate.getTable(req);
+ try {
+ table = delegate.getTable(req);
+ } catch (NoSuchObjectException e) {
+ queryCache.put(cacheKeyNotFound, String.valueOf(e.getMessage()));
Review Comment:
updated
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]