nsivabalan commented on code in PR #9037:
URL: https://github.com/apache/hudi/pull/9037#discussion_r1238935031


##########
hudi-common/src/main/java/org/apache/hudi/io/storage/HoodieAvroHFileReader.java:
##########
@@ -267,14 +263,14 @@ private static Iterator<IndexedRecord> 
getRecordByKeyPrefixIteratorInternal(HFil
     //
     // Consider entries w/ the following keys in HFile: [key01, key02, key03, 
key04,..., key20];
     // In case looked up key-prefix is
-    //    - "key", `seekTo()` will return -1 and place the cursor just before 
"key01",
+    //    - "key", `reseekTo()` will return -1 and place the cursor just 
before "key01",
     //    `getCell()` will return "key01" entry
-    //    - "key03", `seekTo()` will return 0 (exact match) and place the 
cursor just before "key03",
+    //    - "key03", `reseekTo()` will return 0 (exact match) and place the 
cursor just before "key03",
     //    `getCell()` will return "key03" entry
-    //    - "key1", `seekTo()` will return 1 (first not lower than) and place 
the cursor just before
-    //    "key10" (i.e. on "key09");
+    //    - "key1", `reseekTo()` will return 1 (first not lower than) and 
leave the cursor wherever it was just before calling
+    //    reseekTo();
     //
-    int val = scanner.seekTo(kv);
+    int val = scanner.reseekTo(kv);

Review Comment:
   yes, but we might search for non-existant keys as well. thats why, we are 
just interested in "0" where the key is exactly matched. if not matched, the 
next key that we might lookup will definitely be greater than the one that we 
just searched for. So, even if the cursor is moved just before the nearest key 
cell, its totally fine. Infact, thats more performant since the cursor will 
likely closer to the next key that we might look up 



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