VitoMakarevich commented on code in PR #10897:
URL: https://github.com/apache/hudi/pull/10897#discussion_r1536652499
##########
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:
this test does the following:
1. create 1 partition
2. Request 3 partitions(1 created at first step and 2 random ones - copied
from previous version).
3. Assert only real one returned
##########
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:
will rename
--
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]