vikramahuja1001 commented on code in PR #4807:
URL: https://github.com/apache/hive/pull/4807#discussion_r1439180394
##########
ql/src/test/org/apache/hadoop/hive/ql/exec/PartitionUtil.java:
##########
@@ -82,4 +88,26 @@ public static Set<CheckResult.PartitionResult>
createPartsNotInMs(int numOfParts
}
return partsNotInMs;
}
+
+
+ public static void addPartitions(IMetaStoreClient db, String dbName,
String tableName, String location,
+ HiveConf hiveConf, int numPartitions) throws Exception {
+ List<Partition> partitions = new ArrayList<>();
+ for (int i = 0; i < numPartitions; i++) {
+ partitions.add(buildPartition(dbName, tableName,
String.valueOf(i), location + "/city=" + i, hiveConf));
+ }
+ db.add_partitions(partitions, true, true);
+ }
+
+ protected static Partition buildPartition(String dbName, String tableName,
String value,
Review Comment:
It is as a part of refactoring that i moved it to this class as it was being
used in multiple places. If any change is required for this, i can do it as a
part of a follow-up JIRA. Let me know if it required.
--
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]