yihua commented on code in PR #13247:
URL: https://github.com/apache/hudi/pull/13247#discussion_r2070968485
##########
hudi-common/src/test/java/org/apache/hudi/common/table/view/TestHoodieFileGroupSizeEstimator.java:
##########
@@ -47,16 +50,38 @@ void estimatorSkipsTimeline() {
// setup mocks
HoodieFileGroupId fileGroupId = new HoodieFileGroupId("path1",
UUID.randomUUID().toString());
List<FileSlice> fileSlices = Collections.singletonList(new
FileSlice(fileGroupId, "001",
- new HoodieBaseFile("/tmp/" + FSUtils.makeBaseFileName("001", "1-0-1",
fileGroupId.getFileId(), "parquet")), Collections.emptyList()));
+ new HoodieBaseFile("/tmp/" + FSUtils.makeBaseFileName("001", "1-0-1",
fileGroupId.getFileId())), Collections.emptyList()));
when(fileGroup1.getFileGroupId()).thenReturn(fileGroupId);
- when(fileGroup1.getAllFileSlices()).thenReturn(fileSlices.stream());
+
when(fileGroup1.getAllFileSlices()).thenReturn(fileSlices.stream()).thenReturn(fileSlices.stream());
when(fileGroup2.getFileGroupId()).thenReturn(new
HoodieFileGroupId("path2", UUID.randomUUID().toString()));
- when(fileGroup2.getAllFileSlices()).thenReturn(Stream.empty());
+
when(fileGroup2.getAllFileSlices()).thenReturn(Stream.empty()).thenReturn(Stream.empty());
long result = new
HoodieFileGroupSizeEstimator().sizeEstimate(Arrays.asList(fileGroup1,
fileGroup2));
Assertions.assertTrue(result > 0);
verify(fileGroup1, never()).getTimeline();
verify(fileGroup2, never()).getTimeline();
}
+
+ @Test
+ void estimatorWithManyFileSlices() {
+ HoodieFileGroup fileGroup1 = mock(HoodieFileGroup.class);
+ HoodieFileGroup fileGroup2 = mock(HoodieFileGroup.class);
+
+ // setup mocks
+ HoodieFileGroupId fileGroupId = new HoodieFileGroupId("path1",
UUID.randomUUID().toString());
+ List<FileSlice> fileSlices = IntStream.range(1, 100).mapToObj(i -> new
FileSlice(fileGroupId, "001",
+ new HoodieBaseFile("/tmp/" + FSUtils.makeBaseFileName("00" + i,
"1-0-1", fileGroupId.getFileId())),
Collections.emptyList())).collect(Collectors.toList());
Review Comment:
Looks like the API changes so it causes build failure.
--
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]