[ 
https://issues.apache.org/jira/browse/HIVE-22015?focusedWorklogId=454385&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-454385
 ]

ASF GitHub Bot logged work on HIVE-22015:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 03/Jul/20 11:15
            Start Date: 03/Jul/20 11:15
    Worklog Time Spent: 10m 
      Work Description: adesh-rao commented on a change in pull request #1109:
URL: https://github.com/apache/hive/pull/1109#discussion_r449528837



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/CachedStore.java
##########
@@ -867,6 +909,77 @@ private void updateTableColStats(RawStore rawStore, String 
catName, String dbNam
       }
     }
 
+    private void updateTableForeignKeys(RawStore rawStore, String catName, 
String dbName, String tblName) {
+      LOG.debug("CachedStore: updating cached foreign keys objects for 
catalog: {}, database: {}, table: {}", catName,
+              dbName, tblName);
+      try {
+        Deadline.startTimer("getForeignKeys");
+        List<SQLForeignKey> fks = rawStore.getForeignKeys(catName, null, null, 
dbName, tblName);
+        Deadline.stopTimer();
+        
sharedCache.refreshForeignKeysInCache(StringUtils.normalizeIdentifier(catName),
+                StringUtils.normalizeIdentifier(dbName), 
StringUtils.normalizeIdentifier(tblName), fks);
+        LOG.debug("CachedStore: updated cached foreign keys objects for 
catalog: {}, database: {}, table: {}", catName,
+                dbName, tblName);
+      } catch (MetaException e) {
+        LOG.info("Updating CachedStore: unable to read foreign keys of 
catalog: " + catName + ", database: "

Review comment:
       Fixed.




----------------------------------------------------------------
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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 454385)
    Time Spent: 2h 40m  (was: 2.5h)

> [CachedStore] Cache table constraints in CachedStore
> ----------------------------------------------------
>
>                 Key: HIVE-22015
>                 URL: https://issues.apache.org/jira/browse/HIVE-22015
>             Project: Hive
>          Issue Type: Sub-task
>            Reporter: Daniel Dai
>            Assignee: Adesh Kumar Rao
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> Currently table constraints are not cached. Hive will pull all constraints 
> from tables involved in query, which results multiple db reads (including 
> get_primary_keys, get_foreign_keys, get_unique_constraints, etc). The effort 
> to cache this is small as it's just another table component.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to