yihua commented on code in PR #13523:
URL: https://github.com/apache/hudi/pull/13523#discussion_r2231075888


##########
hudi-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadata.java:
##########
@@ -631,6 +602,41 @@ private <T> ClosableIterator<T> lookupRecords(List<String> 
sortedKeys,
     }
   }
 
+  /**
+   * Builds a predicate for querying metadata partitions based on the 
partition type and lookup strategy.
+   * 
+   * Secondary index partitions are treated as a special case where the 
isFullKey parameter is ignored.
+   * This is because secondary index lookups are neither pure prefix lookups 
nor full key lookups, 
+   * but rather use a customized key format: {secondary_key}+${record_key}. 
The lookup always uses
+   * prefix matching to find all record keys associated with a given secondary 
key value.
+   * 
+   * @param partitionName The name of the metadata partition
+   * @param sortedKeys The list of keys to search for
+   * @param isFullKey Whether to perform exact key matching (ignored for 
secondary index partitions)
+   * @return A predicate for filtering records
+   */
+  static Predicate buildPredicate(String partitionName, List<String> 
sortedKeys, boolean isFullKey) {

Review Comment:
   So the confusion looks like to be: the `isFullKey` should indicate whether 
the lookup matches the full keys in the MDT (`isFullKey=true`) or not 
(`isFullKey=false`).  `isFullKey` is not regarding the secondary key.  So in 
that sense, the current way of calling APIs with `isFullKey` does not conform 
to this concept.  Let's follow up to refactor this part.



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