Davis-Zhang-Onehouse commented on code in PR #13523:
URL: https://github.com/apache/hudi/pull/13523#discussion_r2201322103


##########
hudi-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadata.java:
##########
@@ -636,6 +616,34 @@ private <T> ClosableIterator<T> lookupRecords(List<String> 
sortedKeys,
     }
   }
 
+  private Predicate buildPrefixPredicate(String partitionName, List<String> 
sortedKeys) {
+    if (MetadataPartitionType.fromPartitionPath(partitionName)
+          .equals(MetadataPartitionType.SECONDARY_INDEX)) {
+      return Predicates.startsWithAny(null,
+          sortedKeys.stream()
+          .map(SecondaryIndexKeyUtils::constructSecondaryIndexKeyPrefix)
+          .map(Literal::from)
+          .collect(Collectors.toList()));
+    }
+    return Predicates.startsWithAny(null, sortedKeys.stream()
+        .map(Literal::from)
+        .collect(Collectors.toList()));
+  }
+
+  private Predicate  buildPredicate(String partitionName, List<String> 
sortedKeys) {
+    if (MetadataPartitionType.fromPartitionPath(partitionName)
+          .equals(MetadataPartitionType.SECONDARY_INDEX)) {
+      return Predicates.startsWithAny(null,
+          sortedKeys.stream()
+          .map(SecondaryIndexKeyUtils::constructSecondaryIndexKeyPrefix)
+          .map(Literal::from)
+          .collect(Collectors.toList()));
+    }

Review Comment:
   done



##########
hudi-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadata.java:
##########
@@ -615,16 +594,17 @@ private 
ClosableIterator<HoodieRecord<HoodieMetadataPayload>> lookupRecordsItr(S
   /**
    * Lookup records and produce a lazy iterator of mapped HoodieRecords.
    */
-  private <T> ClosableIterator<T> lookupRecords(List<String> sortedKeys,
+  private <T> ClosableIterator<T> lookupRecords(String partitionName,
+                                                List<String> sortedKeys,

Review Comment:
   done



##########
hudi-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadata.java:
##########
@@ -636,6 +616,34 @@ private <T> ClosableIterator<T> lookupRecords(List<String> 
sortedKeys,
     }
   }
 
+  private Predicate buildPrefixPredicate(String partitionName, List<String> 
sortedKeys) {
+    if (MetadataPartitionType.fromPartitionPath(partitionName)
+          .equals(MetadataPartitionType.SECONDARY_INDEX)) {
+      return Predicates.startsWithAny(null,
+          sortedKeys.stream()
+          .map(SecondaryIndexKeyUtils::constructSecondaryIndexKeyPrefix)
+          .map(Literal::from)
+          .collect(Collectors.toList()));
+    }
+    return Predicates.startsWithAny(null, sortedKeys.stream()
+        .map(Literal::from)
+        .collect(Collectors.toList()));
+  }

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