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



##########
File path: 
itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/cache/TestCachedStoreUpdateUsingEvents.java
##########
@@ -419,18 +412,14 @@ public void testConstraintsForUpdateUsingEvents() throws 
Exception {
   public void assertRawStoreAndCachedStoreConstraint(String catName, String 
dbName, String tblName)
       throws MetaException, NoSuchObjectException {
     SQLAllTableConstraints rawStoreConstraints = 
rawStore.getAllTableConstraints(catName, dbName, tblName);
-    List<SQLPrimaryKey> primaryKeys = 
sharedCache.listCachedPrimaryKeys(catName, dbName, tblName);
-    List<SQLNotNullConstraint> notNullConstraints = 
sharedCache.listCachedNotNullConstraints(catName, dbName, tblName);
-    List<SQLUniqueConstraint> uniqueConstraints = 
sharedCache.listCachedUniqueConstraint(catName, dbName, tblName);
-    List<SQLDefaultConstraint> defaultConstraints = 
sharedCache.listCachedDefaultConstraint(catName, dbName, tblName);
-    List<SQLCheckConstraint> checkConstraints = 
sharedCache.listCachedCheckConstraint(catName, dbName, tblName);
-    List<SQLForeignKey> foreignKeys = 
sharedCache.listCachedForeignKeys(catName, dbName, tblName, null, null);
-    Assert.assertEquals(rawStoreConstraints.getPrimaryKeys(), primaryKeys);
-    Assert.assertEquals(rawStoreConstraints.getNotNullConstraints(), 
notNullConstraints);
-    Assert.assertEquals(rawStoreConstraints.getUniqueConstraints(), 
uniqueConstraints);
-    Assert.assertEquals(rawStoreConstraints.getDefaultConstraints(), 
defaultConstraints);
-    Assert.assertEquals(rawStoreConstraints.getCheckConstraints(), 
checkConstraints);
-    Assert.assertEquals(rawStoreConstraints.getForeignKeys(), foreignKeys);
+    SQLAllTableConstraints cachedStoreConstraints = new 
SQLAllTableConstraints();
+    
cachedStoreConstraints.setPrimaryKeys(sharedCache.listCachedPrimaryKeys(catName,
 dbName, tblName));
+    
cachedStoreConstraints.setForeignKeys(sharedCache.listCachedForeignKeys(catName,
 dbName, tblName, null, null));
+    
cachedStoreConstraints.setNotNullConstraints(sharedCache.listCachedNotNullConstraints(catName,
 dbName, tblName));
+    
cachedStoreConstraints.setDefaultConstraints(sharedCache.listCachedDefaultConstraint(catName,
 dbName, tblName));
+    
cachedStoreConstraints.setCheckConstraints(sharedCache.listCachedCheckConstraint(catName,
 dbName, tblName));
+    
cachedStoreConstraints.setUniqueConstraints(sharedCache.listCachedUniqueConstraint(catName,
 dbName, tblName));
+    Assert.assertEquals(rawStoreConstraints,cachedStoreConstraints);

Review comment:
       Done




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