sankarh commented on a change in pull request #1610:
URL: https://github.com/apache/hive/pull/1610#discussion_r578260034
##########
File path:
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/CachedStore.java
##########
@@ -2674,28 +2554,19 @@ 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
Review comment:
This check is done in several places. Shall add utility method for this.
##########
File path:
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/events/CreateTableEvent.java
##########
@@ -29,11 +30,14 @@
private final Table table;
private final boolean isReplicated;
+ private final SQLAllTableConstraints constraints;
- public CreateTableEvent(Table table, boolean status, IHMSHandler handler,
boolean isReplicated) {
+ public CreateTableEvent(Table table, boolean status, IHMSHandler handler,
boolean isReplicated,
+ SQLAllTableConstraints constraints) {
Review comment:
We have separate events for add individual constraints. I think, we need
not keep it as part of create table event.
It adds additional overhead when transmit events for incremental
replication. Also, takes additional storage in HMS.
##########
File path:
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/SharedCache.java
##########
@@ -2187,8 +2160,10 @@ public void addPrimaryKeysToCache(String catName, String
dbName, String tblName,
cacheLock.readLock().lock();
String tblKey = CacheUtils.buildTableKey(catName, dbName, tblName);
TableWrapper tblWrapper = tableCache.getIfPresent(tblKey);
- if (tblWrapper != null) {
- tblWrapper.cachePrimaryKeys(keys, false);
+ if ((tblWrapper != null) && tblWrapper.isConstraintsValid()) {
+ // Because lake of snapshot freshness validation.
+ // For now disabling cached constraint snapshot addition in parts by
invalidating constraint snapshot.
+ tblWrapper.inValidateConstraints();
Review comment:
invalidate is single word in this context.Change method name to
invalidateConstraintsCache.
----------------------------------------------------------------
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]