yihua commented on code in PR #13670:
URL: https://github.com/apache/hudi/pull/13670#discussion_r2252561447


##########
hudi-common/src/test/java/org/apache/hudi/common/table/read/buffer/TestSortedKeyBasedFileGroupRecordBuffer.java:
##########
@@ -58,31 +70,92 @@ class TestSortedKeyBasedFileGroupRecordBuffer {
   private final TestRecord testRecord6 = new TestRecord("6", 0);
   private final TestRecord testRecord6Update = new TestRecord("6", 1);
 
+  private final IndexedRecord testIndexedRecord1 = createTestRecord("1", 1, 
1L);
+  private final IndexedRecord testIndexedRecord2 = createTestRecord("2", 1, 
1L);
+  private final IndexedRecord testIndexedRecord2Update = createTestRecord("2", 
1, 2L);
+  private final IndexedRecord testIndexedRecord3 = createTestRecord("3", 1, 
1L);
+  private final IndexedRecord testIndexedRecord4 = createTestRecord("4", 2, 
2L);
+  private final IndexedRecord testIndexedRecord4LowerOrdering = 
createTestRecord("4", 2, 1L);
+  private final IndexedRecord testIndexedRecord5 = createTestRecord("5", 1, 
1L);
+  private final IndexedRecord testRecord5DeleteByCustomMarker = 
createTestRecord("5", 3, 2L);
+  private final IndexedRecord testIndexedRecord6 = createTestRecord("6", 1, 
5L);
+  private final IndexedRecord testIndexedRecord6Update = createTestRecord("6", 
2, 10L);
+
   @Test
   void readBaseFileAndLogFile() throws IOException {
     HoodieReadStats readStats = new HoodieReadStats();
     HoodieReaderContext<TestRecord> mockReaderContext = 
mock(HoodieReaderContext.class, RETURNS_DEEP_STUBS);
+
     SortedKeyBasedFileGroupRecordBuffer<TestRecord> fileGroupRecordBuffer = 
buildSortedKeyBasedFileGroupRecordBuffer(mockReaderContext, readStats);
 
     
fileGroupRecordBuffer.setBaseFileIterator(ClosableIterator.wrap(Arrays.asList(testRecord2,
 testRecord3, testRecord5).iterator()));
 
     HoodieDataBlock dataBlock = mock(HoodieDataBlock.class);
     
when(dataBlock.getSchema()).thenReturn(HoodieTestDataGenerator.AVRO_SCHEMA);
-    
when(dataBlock.getEngineRecordIterator(mockReaderContext)).thenReturn(ClosableIterator.wrap(Arrays.asList(testRecord6,
 testRecord4, testRecord1, testRecord6Update, testRecord2Update).iterator()));
+    when(dataBlock.getEngineRecordIterator(mockReaderContext)).thenReturn(
+        ClosableIterator.wrap(Arrays.asList(testRecord6, testRecord4, 
testRecord1, testRecord6Update, testRecord2Update).iterator()));
 
     HoodieDeleteBlock deleteBlock = mock(HoodieDeleteBlock.class);
-    when(deleteBlock.getRecordsToDelete()).thenReturn(new 
DeleteRecord[]{DeleteRecord.create("3", "")});
+    when(deleteBlock.getRecordsToDelete()).thenReturn(new DeleteRecord[] 
{DeleteRecord.create("3", "")});
     fileGroupRecordBuffer.processDataBlock(dataBlock, Option.empty());
     fileGroupRecordBuffer.processDeleteBlock(deleteBlock);
 
-
-    List<TestRecord> actualRecords = getActualRecords(fileGroupRecordBuffer);
+    List<TestRecord> actualRecords = 
getActualRecordsForSortedKeyBased(fileGroupRecordBuffer);
     assertEquals(Arrays.asList(testRecord1, testRecord2Update, testRecord4, 
testRecord5, testRecord6Update), actualRecords);
     assertEquals(3, readStats.getNumInserts());
     assertEquals(1, readStats.getNumUpdates());
     assertEquals(1, readStats.getNumDeletes());
   }
 
+  @Test
+  void readWithStreamingRecordBufferLoaderAndEventTimeOrdering() throws 
IOException {

Review Comment:
   nit: move this too



##########
hudi-common/src/test/java/org/apache/hudi/common/table/read/buffer/TestKeyBasedFileGroupRecordBuffer.java:
##########
@@ -176,12 +205,49 @@ void readWithCommitTimeOrdering() throws IOException {
     assertEquals(2, readStats.getNumUpdates());
   }
 
+  @Test
+  void readWithCommitTimeOrderingWithRecords() throws IOException {

Review Comment:
   Could this test and other new tests for streaming loader be removed since 
it's added in the new test class for streaming record buffer loader?



-- 
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]

Reply via email to