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


##########
hudi-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadata.java:
##########
@@ -319,12 +319,13 @@ private HoodiePairData<String, 
HoodieRecord<HoodieMetadataPayload>> doLookup(Hoo
    */
   private HoodieData<HoodieRecord<HoodieMetadataPayload>> 
doLookupIndexRecords(HoodieData<String> keys, String partitionName, 
List<FileSlice> fileSlices,
                                                                                
SerializableFunctionUnchecked<String, String> keyEncodingFn) {
+    boolean isSecondaryIndex = 
MetadataPartitionType.fromPartitionPath(partitionName).equals(MetadataPartitionType.SECONDARY_INDEX);
 
     final int numFileSlices = fileSlices.size();
     if (numFileSlices == 1) {
       List<String> keysList = keys.map(keyEncodingFn::apply).collectAsList();
       TreeSet<String> distinctSortedKeys = new TreeSet<>(keysList);
-      return lookupRecords(partitionName, new ArrayList<>(distinctSortedKeys), 
fileSlices.get(0));
+      return lookupRecords(partitionName, new ArrayList<>(distinctSortedKeys), 
fileSlices.get(0), !isSecondaryIndex);

Review Comment:
   they stick to the old behavior. No code change on that part. All the index 
related code I have done is refactoring the existing DAG of prefix lookup and 
full key lookup with a few branching for Secondary index.
   
   Col stats they just call get record by keys / get records by key prefix as 
needed.



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