[ 
https://issues.apache.org/jira/browse/HIVE-26278?focusedWorklogId=777350&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-777350
 ]

ASF GitHub Bot logged work on HIVE-26278:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/Jun/22 08:36
            Start Date: 02/Jun/22 08:36
    Worklog Time Spent: 10m 
      Work Description: kasakrisz commented on code in PR #3335:
URL: https://github.com/apache/hive/pull/3335#discussion_r887711290


##########
ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHiveMetaStoreClientApiArgumentsChecker.java:
##########
@@ -146,6 +151,26 @@ public void testGetPartitionsByNames3() throws 
HiveException {
     hive.getPartitionsByNames(t, new ArrayList<>(), true);
   }
 
+  @Test
+  public void testGetPartitionsByNamesWithSingleBatch() throws HiveException {
+    hive.getPartitionsByNames(t, Arrays.asList("Greece", "Italy"), true);
+  }
+
+  @Test
+  public void testGetPartitionsByNamesWithMultipleEqualSizeBatches()
+      throws HiveException {
+    List<String> names = Arrays.asList("Greece", "Italy", "France", "Spain");
+    hive.getPartitionsByNames(t, names, true);
+  }
+
+  @Test
+  public void testGetPartitionsByNamesWithMultipleUnequalSizeBatches()
+      throws HiveException {
+    List<String> names =
+        Arrays.asList("Greece", "Italy", "France", "Spain", "Hungary");
+    hive.getPartitionsByNames(t, names, true);

Review Comment:
   Could you please add some asserts into these test methods like is the result 
of `getPartitionsByNames` contains partitions we expect.
   Example:
   ```
       List<Partitions> result = objectStore.getAllStoredProcedures(new 
ListStoredProcedureRequest("hive"));
       Assert.assertEquals(5, result.size());
       assertThat(result.get(0).getName, is("Greece"));
   ...
   ```
   It would be also good to know how many times was the method 
`IMetaStoreClient.getPartitionsByNames` called. I think to get this a mock 
framework should be used. Mockito is already used in some Hive tests.
   





Issue Time Tracking
-------------------

    Worklog Id:     (was: 777350)
    Time Spent: 40m  (was: 0.5h)

> Add unit tests for Hive#getPartitionsByNames using batching
> -----------------------------------------------------------
>
>                 Key: HIVE-26278
>                 URL: https://issues.apache.org/jira/browse/HIVE-26278
>             Project: Hive
>          Issue Type: Sub-task
>          Components: HiveServer2
>            Reporter: Stamatis Zampetakis
>            Assignee: Stamatis Zampetakis
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> [Hive#getPartitionsByNames|https://github.com/apache/hive/blob/6626b5564ee206db5a656d2f611ed71f10a0ffc1/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java#L4155]
>  supports decomposing requests in batches but there are no unit tests 
> checking for the ValidWriteIdList when batching is used.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to