yihua commented on code in PR #13634:
URL: https://github.com/apache/hudi/pull/13634#discussion_r2237921440
##########
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:
Got it. After reading the code, column stats are read by using
`HoodieBackedTableMetadata#getRecordsByKeyPrefixes` which calls
`HoodieBackedTableMetadata#lookupRecords` directly, not going through
`HoodieBackedTableMetadata#doLookupIndexRecords`. The methods are bit
confusing now in terms of the scope, i.e., which indexes use certain API. We
should do a follow-up refactoring. For now, the change here keeps the existing
functionality.
--
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]