ashish-kumar-sharma commented on a change in pull request #1610:
URL: https://github.com/apache/hive/pull/1610#discussion_r575929235



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/SharedCache.java
##########
@@ -506,10 +512,18 @@ boolean cacheCheckConstraints(List<SQLCheckConstraint> 
checkConstraints, boolean
       return cacheConstraints(checkConstraints, fromPrewarm, 
MemberName.CHECK_CONSTRAINT_CACHE);
     }
 
+    boolean cacheConstraints(SQLAllTableConstraints constraints, boolean 
fromPrewarm) {
+      this.isConstraintsValid =
+          cacheConstraints(constraints.getPrimaryKeys(), fromPrewarm, 
MemberName.PRIMARY_KEY_CACHE) && cacheConstraints(
+              constraints.getForeignKeys(), fromPrewarm, 
MemberName.FOREIGN_KEY_CACHE) && 
cacheConstraints(constraints.getDefaultConstraints(), fromPrewarm, 
MemberName.DEFAULT_CONSTRAINT_CACHE)
+              && cacheConstraints(constraints.getUniqueConstraints(), 
fromPrewarm, MemberName.UNIQUE_CONSTRAINT_CACHE)
+              && cacheConstraints(constraints.getNotNullConstraints(), 
fromPrewarm, MemberName.NOTNULL_CONSTRAINT_CACHE)
+              && cacheConstraints(constraints.getCheckConstraints(), 
fromPrewarm, MemberName.CHECK_CONSTRAINT_CACHE);
+      return this.isConstraintsValid;
+    }
+
     // Common method to cache constraints
-    private boolean cacheConstraints(List constraintsList,
-                             boolean fromPrewarm,
-                             MemberName mn) {
+    private boolean cacheConstraints(List constraintsList, boolean 
fromPrewarm, MemberName mn) {

Review comment:
       In case of wrong member type.




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