parisni commented on code in PR #10897:
URL: https://github.com/apache/hudi/pull/10897#discussion_r1536642499
##########
hudi-aws/src/test/java/org/apache/hudi/aws/sync/ITTestGluePartitionPushdown.java:
##########
@@ -131,8 +151,40 @@ public void testEmptyPartitionShouldReturnEmpty() {
@Test
public void testPresentPartitionShouldReturnIt() throws ExecutionException,
InterruptedException {
- createPartitions("1", "b'ar");
+ List<String> partitions = createPartitions(1, 2, true);
Assertions.assertEquals(1, glueSync.getPartitionsFromList(TABLE_NAME,
- Arrays.asList("1/b'ar", "2/foo", "1/b''ar")).size());
+ Arrays.asList(partitions.get(0), "2/foo", "1/b''ar")).size());
Review Comment:
not sure how this test can work. The createPartition likely doesn't create
what's in the assertion anymore.
##########
hudi-aws/src/test/java/org/apache/hudi/aws/sync/ITTestGluePartitionPushdown.java:
##########
@@ -131,8 +151,40 @@ public void testEmptyPartitionShouldReturnEmpty() {
@Test
public void testPresentPartitionShouldReturnIt() throws ExecutionException,
InterruptedException {
- createPartitions("1", "b'ar");
+ List<String> partitions = createPartitions(1, 2, true);
Assertions.assertEquals(1, glueSync.getPartitionsFromList(TABLE_NAME,
- Arrays.asList("1/b'ar", "2/foo", "1/b''ar")).size());
+ Arrays.asList(partitions.get(0), "2/foo", "1/b''ar")).size());
+ }
+
+ @Test
+ public void testCreatingManyPartitionsAndThenReadingAllShouldShowAll()
throws ExecutionException, InterruptedException {
+ List<String> partitions = createPartitions(2000, 2, false);
+ glueSync.addPartitionsToTable(TABLE_NAME, partitions);
+ Assertions.assertEquals(partitions.size(),
glueSync.getAllPartitions(TABLE_NAME).size());
+ }
+
+ @Test
+ public void testDeletingManyPartitions() throws ExecutionException,
InterruptedException {
+ List<String> partitions = createPartitions(2000, 2, true);
+ int firstDeleteBatch = 1000;
+ glueSync.dropPartitions(TABLE_NAME, partitions.subList(0,
firstDeleteBatch));
+ Assertions.assertEquals(partitions.size() - 1000,
glueSync.getAllPartitions(TABLE_NAME).size());
+ glueSync.dropPartitions(TABLE_NAME, partitions.subList(firstDeleteBatch,
partitions.size()));
+ Assertions.assertEquals(0, glueSync.getAllPartitions(TABLE_NAME).size());
+ }
+
+ @Test
+ public void testReadFromList() throws ExecutionException,
InterruptedException {
Review Comment:
maybe keep coherent way to name the tests among all methods ?
`test...should...` is more meaningful to me than the other
--
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]