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


##########
hudi-io/src/test/java/org/apache/hudi/io/hfile/TestHFileReader.java:
##########
@@ -268,6 +271,33 @@ public void testReadHFilePointAndPrefixLookup(String 
filename,
     verifyHFileRead(filename, numEntries, KEY_CREATOR, VALUE_CREATOR, 
keyLookUpInfoList);
   }
 
+  @Test
+  public void testReadHFileCorrupted() throws Exception {
+    List<String> keys = new ArrayList<>();
+    try (HFileReader reader = 
getHFileReader("/hfile/col-stats-0001-0_1-170431-5847084_20250418193125815.hfile"))
 {
+      reader.initializeMetadata();
+      boolean available = reader.seekTo();
+      while (available) {
+        keys.add(reader.getKeyValue().get().getKey().getContentInString());
+        available = reader.next();
+      }
+    }
+    List<String> sortedKeys = new ArrayList<>(keys);
+    Collections.sort(sortedKeys);
+    assertEquals(sortedKeys, keys);
+  }
+
+  @Test
+  public void testSeekKeyDoesNotExist() throws Exception {

Review Comment:
   Could the new lookup key case added to 
`testArgsReadHFilePointAndPrefixLookup` using existing test fixtures instead of 
adding a test method?



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