ashish-kumar-sharma commented on a change in pull request #1610:
URL: https://github.com/apache/hive/pull/1610#discussion_r574409143
##########
File path:
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/SharedCache.java
##########
@@ -1788,47 +1771,16 @@ public boolean populateTableInCache(Table table,
TableCacheObjects cacheObjects)
tblWrapper.setMemberCacheUpdated(MemberName.PARTITION_COL_STATS_CACHE,
false);
tblWrapper.setMemberCacheUpdated(MemberName.AGGR_COL_STATS_CACHE, false);
- if (CollectionUtils.isNotEmpty(constraints.getPrimaryKeys())) {
- if (!tblWrapper.cachePrimaryKeys(constraints.getPrimaryKeys(), true)) {
- return false;
- }
- }
- tblWrapper.setMemberCacheUpdated(MemberName.PRIMARY_KEY_CACHE, false);
-
- if (CollectionUtils.isNotEmpty(constraints.getForeignKeys())) {
- if (!tblWrapper.cacheForeignKeys(constraints.getForeignKeys(), true)) {
- return false;
- }
- }
- tblWrapper.setMemberCacheUpdated(MemberName.FOREIGN_KEY_CACHE, false);
-
- if (CollectionUtils.isNotEmpty(constraints.getNotNullConstraints())) {
- if
(!tblWrapper.cacheNotNullConstraints(constraints.getNotNullConstraints(),
true)) {
- return false;
- }
- }
- tblWrapper.setMemberCacheUpdated(MemberName.NOTNULL_CONSTRAINT_CACHE,
false);
-
- if (CollectionUtils.isNotEmpty(constraints.getUniqueConstraints())) {
- if
(!tblWrapper.cacheUniqueConstraints(constraints.getUniqueConstraints(), true)) {
- return false;
- }
- }
- tblWrapper.setMemberCacheUpdated(MemberName.UNIQUE_CONSTRAINT_CACHE,
false);
-
- if (CollectionUtils.isNotEmpty(constraints.getDefaultConstraints())) {
- if
(!tblWrapper.cacheDefaultConstraints(constraints.getDefaultConstraints(),
true)) {
- return false;
- }
- }
- tblWrapper.setMemberCacheUpdated(MemberName.DEFAULT_CONSTRAINT_CACHE,
false);
-
- if (CollectionUtils.isNotEmpty(constraints.getCheckConstraints())) {
- if (!tblWrapper.cacheCheckConstraints(constraints.getCheckConstraints(),
true)) {
- return false;
- }
+ if(tblWrapper.cacheConstraints(constraints,true)) {
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]