Indhumathi27 commented on code in PR #4807:
URL: https://github.com/apache/hive/pull/4807#discussion_r1375784452
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java:
##########
@@ -4026,6 +4031,41 @@ public List<String> listPartitionNamesPs(String catName,
String dbName, String t
return partitionNames;
}
+ private List<MPartition> listMPartitionsByNames(String catName, String
dbName, String tableName,
+ List<String> partNames) throws Exception {
+ LOG.debug("Executing listMPartitionsByNames");
+
+ Preconditions.checkState(this.currentTransaction.isActive());
Review Comment:
Can you refactor common code from listMPartitionsByNames and listMPartitions
methods
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java:
##########
@@ -4026,6 +4031,41 @@ public List<String> listPartitionNamesPs(String catName,
String dbName, String t
return partitionNames;
}
+ private List<MPartition> listMPartitionsByNames(String catName, String
dbName, String tableName,
+ List<String> partNames) throws Exception {
+ LOG.debug("Executing listMPartitionsByNames");
+
+ Preconditions.checkState(this.currentTransaction.isActive());
+
+ dbName = normalizeIdentifier(dbName);
+ tableName = normalizeIdentifier(tableName);
+
+ List<MPartition> result = Collections.emptyList();
+ try (Query query = pm.newQuery(MPartition.class)) {
+ String paramStr = "java.lang.String t1, java.lang.String t2,
java.lang.String t3";
+ String filter = "table.tableName == t1 && table.database.name == t2 &&
table.database.catalogName == t3 && (";
+ Object[] params = new Object[partNames.size() + 3];
+ int i = 0;
+ params[i++] = tableName;
+ params[i++] = dbName;
+ params[i++] = catName;
+ int firstI = i;
+ for (String s : partNames) {
Review Comment:
```suggestion
for (String partitionName : partNames) {
```
--
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]