wecharyu commented on code in PR #4517:
URL: https://github.com/apache/hive/pull/4517#discussion_r1317567686
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java:
##########
@@ -532,6 +535,66 @@ public void addPartitions(List<MPartition> parts,
List<List<MPartitionPrivilege>
directSqlInsertPart.addPartitions(parts, partPrivilegesList,
partColPrivilegesList);
}
+ /**
+ * Alter partitions in batch using direct SQL
+ * @param table the target table
+ * @param partNames list of partition names
+ * @param newParts list of new partitions
+ * @param queryWriteIdList valid write id list
+ * @return
+ * @throws MetaException
+ */
+ public List<Partition> alterPartitions(Table table, List<String> partNames,
+ List<Partition> newParts, String queryWriteIdList) throws MetaException {
+ String filter = "" + PARTITIONS + ".\"PART_NAME\" in (" +
makeParams(partNames.size()) + ")";
Review Comment:
There should be no limit on 'IN' clause, and there are also many calls of
`makeParams()` in `MetaStoreDirectSql`, for ex:
https://github.com/apache/hive/blob/920f9e535db6270a401db274eef3267d70c1fd2f/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java#L671-L674
Nevertheless, I think it is reasonable to query in batch just like below.
--
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]