You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "nsivabalan (via GitHub)" <gi...@apache.org> on 2023/06/22 19:16:42 UTC
[GitHub] [hudi] nsivabalan commented on a diff in pull request #9037: [HUDI-6420][WIP] Fixing seekTo() calls with hfile readers to reseek wherever applicable
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org