adesh-rao commented on a change in pull request #1610:
URL: https://github.com/apache/hive/pull/1610#discussion_r572168261



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/CachedStore.java
##########
@@ -1325,6 +1204,7 @@ private void validateTableType(Table tbl) {
     }
     validateTableType(tbl);
     sharedCache.addTableToCache(catName, dbName, tblName, tbl);
+    sharedCache.addTableConstraintsToCache(catName,dbName,tblName,new 
SQLAllTableConstraints());

Review comment:
       There is a separate api for createTableWithConstraints. 
   
   Is this api also used when table is created with constraints?

##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/CachedStore.java
##########
@@ -2814,21 +2649,12 @@ long getPartsFound() {
     catName = StringUtils.normalizeIdentifier(catName);
     dbName = StringUtils.normalizeIdentifier(dbName);
     tblName = StringUtils.normalizeIdentifier(tblName);
-    if (!shouldCacheTable(catName, dbName, tblName) || (canUseEvents && 
rawStore.isActiveTransaction())) {
+    if (!shouldCacheTable(catName, dbName, tblName) || (canUseEvents && 
rawStore.isActiveTransaction()) || !sharedCache
+        .isTableConstraintValid(catName, dbName, tblName)) {
       return rawStore.getCheckConstraints(catName, dbName, tblName);
     }
+    return sharedCache.listCachedCheckConstraint(catName, dbName, tblName);

Review comment:
       below check was present earlier:
   
   ```
   if (CollectionUtils.isEmpty(keys)) { 
         return rawStore.getCheckConstraints(catName, dbName, tblName); 
   }
   ```
   
   Why is this removed? Is this check moved somewhere else?

##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/SharedCache.java
##########
@@ -418,12 +424,12 @@ private void updateMemberSize(MemberName mn, Integer 
size, SizeMode mode) {
       }
 
       switch (mode) {
-        case Delta:
-          this.memberObjectsSize[mn.ordinal()] += size;
-          break;
-        case Snapshot:
-          this.memberObjectsSize[mn.ordinal()] = size;
-          break;
+      case Delta:

Review comment:
       nit: need extra spaces before case?




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to