yongzhi commented on a change in pull request #1956:
URL: https://github.com/apache/hive/pull/1956#discussion_r577305917
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
##########
@@ -3195,17 +3196,24 @@ public void alterPartitions(String dbName, String
tableName,
public List<org.apache.hadoop.hive.metastore.api.Partition>
getPartitionsByNames(String dbName, String tableName,
List<String> partitionNames) throws HiveException {
try {
- return getMSC().getPartitionsByNames(dbName, tableName, partitionNames);
+ GetPartitionsByNamesRequest req = new GetPartitionsByNamesRequest();
+ req.setDb_name(dbName);
+ req.setTbl_name(tableName);
+ req.setNames(partitionNames);
+ return getPartitionsByNames(req, null);
} catch (Exception e) {
LOG.error("Failed getPartitionsByNames", e);
throw new HiveException(e);
}
}
- public List<org.apache.hadoop.hive.metastore.api.Partition>
getPartitionsByNames(GetPartitionsByNamesRequest req)
+ public List<org.apache.hadoop.hive.metastore.api.Partition>
getPartitionsByNames(GetPartitionsByNamesRequest req,
+ Table table)
throws HiveException {
try {
- Table table = getTable(req.getDb_name(), req.getTbl_name());
+ if( table == null ) {
+ table = getTable(req.getDb_name(), req.getTbl_name());
Review comment:
This can cause a round trip to HMS to get the table too for none cached
client. I think you can add the logic here:
https://github.com/apache/hive/blob/master/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClientWithLocalCache.java#L460
----------------------------------------------------------------
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]