soumyakanti3578 commented on a change in pull request #3020:
URL: https://github.com/apache/hive/pull/3020#discussion_r806091142



##########
File path: 
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClientWithLocalCache.java
##########
@@ -493,6 +495,32 @@ protected GetPartitionsByNamesResult 
getPartitionsByNamesInternal(GetPartitionsB
     return super.getPartitionsByNamesInternal(rqst);
   }
 
+  @Override
+  public void alter_partitions(String catName, String dbName, String tblName, 
List<Partition> newParts,
+                               EnvironmentContext environmentContext, String 
writeIdList, long writeId)
+          throws TException {
+    super.alter_partitions(catName, dbName, tblName, newParts, 
environmentContext, writeIdList, writeId);
+
+    if (!isCacheEnabledAndInitialized() || mscLocalCache == null) {
+      return;
+    }
+
+    // invalidate cached Partition entries
+    List<String> processorCapabilitiesList = getProcessorCapabilities() == 
null ?
+            null : new ArrayList<>(Arrays.asList(getProcessorCapabilities()));

Review comment:
       Is it better to call `getProcessorCapabilities()` just once?

##########
File path: 
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClientWithLocalCache.java
##########
@@ -493,6 +495,32 @@ protected GetPartitionsByNamesResult 
getPartitionsByNamesInternal(GetPartitionsB
     return super.getPartitionsByNamesInternal(rqst);
   }
 
+  @Override
+  public void alter_partitions(String catName, String dbName, String tblName, 
List<Partition> newParts,
+                               EnvironmentContext environmentContext, String 
writeIdList, long writeId)
+          throws TException {
+    super.alter_partitions(catName, dbName, tblName, newParts, 
environmentContext, writeIdList, writeId);
+
+    if (!isCacheEnabledAndInitialized() || mscLocalCache == null) {
+      return;
+    }
+
+    // invalidate cached Partition entries
+    List<String> processorCapabilitiesList = getProcessorCapabilities() == 
null ?
+            null : new ArrayList<>(Arrays.asList(getProcessorCapabilities()));
+
+    TableWatermark watermark = new TableWatermark(writeIdList, 
getTable(dbName, tblName).getId());
+    dbName =prependCatalogToDbName(catName, dbName, conf);

Review comment:
       Small change, need a space after `=`.




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

To unsubscribe, e-mail: [email protected]

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