zratkai commented on code in PR #4912:
URL: https://github.com/apache/hive/pull/4912#discussion_r1415505514
##########
ql/src/test/org/apache/hadoop/hive/ql/exec/TestGetPartitionInBatches.java:
##########
@@ -256,4 +258,21 @@ public void testBatchingWhenException() throws Exception {
// In case any duplicate/incomplete list is given by
hive.getAllPartitionsInBatches, the below assertion will fail
assert(partNames.size() == 0);
}
+
+ @Test
+ public void testBatchingWhenBatchSizeIsZero() throws MetaException {
+ HiveMetaStoreClient spyMSC = spy(msc);
+ hive.setMSC(spyMSC);
+ int batchSize = 0;
+ try {
+ new PartitionIterable(hive, hive.getTable(dbName, tableName),
null, batchSize);
+ } catch (HiveException e) {
+ Assert.assertTrue(e.getMessage().contains("Batch Size for
Partition Iterable should be > 0"));
Review Comment:
@aturoczy I agree with you. I think the easiest solution would be to create
an enum for different type of exceptions, and make it as mandatory constructor
value for HiveException. Something similar refactoring was done in Spark:
https://issues.apache.org/jira/browse/SPARK-35958
--
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]