danny0405 commented on code in PR #13150:
URL: https://github.com/apache/hudi/pull/13150#discussion_r2046096514


##########
hudi-hadoop-common/src/main/java/org/apache/hudi/io/hadoop/HoodieHBaseAvroHFileReader.java:
##########
@@ -338,32 +339,52 @@ public boolean hasNext() {
           return false;
         }
 
-        Cell c = Objects.requireNonNull(scanner.getCell());
-        byte[] keyBytes = copyKeyFromCell(c);
-        String key = new String(keyBytes);
-        // Check whether we're still reading records corresponding to the 
key-prefix
-        if (!key.startsWith(keyPrefix)) {
-          return false;
-        }
-
-        // Extract the byte value before releasing the lock since we cannot 
hold on to the returned cell afterwards
-        byte[] valueBytes = copyValueFromCell(c);
         try {
+          // Initialize scanner if needed
+          if (!initialized) {
+            initialized = true;

Review Comment:
   we can eliminate the `initialized` variable, just use the `eof == true` to 
returns early for next `#hasNext` should be fine.



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