codope opened a new pull request, #11575: URL: https://github.com/apache/hudi/pull/11575
### Change Logs When there are no log files in index, then the lookup returns no secondary keys or candidate files, because of a bug - `logRecordsMap` is empty in this code and base file records are ignored - https://github.com/apache/hudi/blob/70f44efe298771fcef9d029820a9b431e1ff165c/hudi-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadata.java#L970 Even though current tests for pruning asserts the filtered files count < total data files count. It is weak in the sense that it does not filtered files count > 0, and hence the assertion passed even when filtered files count = 0. This PR fixes the code and the test. The test without the change in `HoodieBackedTableMetadata` will fail. With the change, we also see number of files getting scanned is lesser (without the change, number of files read is more than 1): <img width="467" alt="Screenshot 2024-07-05 at 3 39 52 PM" src="https://github.com/apache/hudi/assets/16440354/47898914-daaf-4f3f-9da6-05dadbbda31b"> ### Impact Data skipping with secondary index ### Risk level (write none, low medium or high below) none ### Documentation Update _Describe any necessary documentation update if there is any new feature, config, or user-facing change. If not, put "none"._ - _The config description must be updated if new configs are added or the default value of the configs are changed_ - _Any new feature or user-facing change requires updating the Hudi website. Please create a Jira ticket, attach the ticket number here and follow the [instruction](https://hudi.apache.org/contribute/developer-setup#website) to make changes to the website._ ### Contributor's checklist - [ ] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute) - [ ] Change Logs and Impact were stated clearly - [ ] Adequate tests were added if applicable - [ ] CI passed -- 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]
