linliu-code commented on code in PR #13388:
URL: https://github.com/apache/hudi/pull/13388#discussion_r2132488524


##########
hudi-common/src/main/java/org/apache/hudi/io/storage/HoodieNativeAvroHFileReader.java:
##########
@@ -233,6 +237,46 @@ public ClosableIterator<HoodieRecord<IndexedRecord>> 
getRecordsByKeyPrefixIterat
         iterator, data -> unsafeCast(new HoodieAvroIndexedRecord(data)));
   }
 
+  @Override
+  public boolean supportKeyPredicate() {
+    return true;
+  }
+
+  @Override
+  public boolean supportKeyPrefixPredicate() {
+    return true;
+  }
+
+  @Override
+  public List<String> extractKeys(Option<Predicate> keyFilterOpt) {
+    List<String> keys = new ArrayList<>();
+    if (keyFilterOpt.isPresent()
+        && keyFilterOpt.get().getOperator().equals(Expression.Operator.IN)) {
+      List<Expression> children = ((Predicates.In) 
keyFilterOpt.get()).getRightChildren();
+      keys = children.stream().map(e -> (String) 
e.eval(null)).collect(Collectors.toList());
+    }
+
+    if (keys.isEmpty() && keyFilterOpt.isPresent()) {
+      LOG.warn("Cannot extract valid keys from predicate: {}", 
keyFilterOpt.get());
+    }
+    return keys;
+  }
+
+  @Override
+  public List<String> extractKeyPrefixes(Option<Predicate> keyFilterOpt) {
+    List<String> keys = new ArrayList<>();

Review Comment:
   Done.



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