wombatu-kun opened a new pull request, #19456: URL: https://github.com/apache/hudi/pull/19456
### Describe the issue this Pull Request addresses Closes #19387, which carries the analysis, the trigger conditions and the measurements. ### Summary and Changelog Resolve pushed-down predicate columns the same way the projection is already resolved, so a predicate prunes row groups on the column it was written for instead of on whichever column sits at its stale metastore ordinal. - New `remapPredicateColumnIndicesToPhysical`, applied through a private `getPushdownPredicate`. The name-based mode and every path where pushdown is off are untouched. - A column the file does not carry is dropped from the predicate. That costs pruning, never a row, because `HudiMetadata.applyFilter` returns the whole regular predicate as the remaining filter. - Handles are deduplicated on the physical index, not on the rebuilt handle: two names differing only by case resolve to one file column while staying unequal, and pushing both down would fail the split on `getParquetTupleDomain`'s duplicate `ColumnDescriptor`. - `remapColumnIndicesToPhysical` is re-expressed on shared private helpers so the two remaps cannot drift apart. One difference is folded in: the handle rebuild now passes `getBaseType()` rather than `getType()`, since the constructor's fourth argument is the base column's type. Unreachable today because `HudiMetadata` has no `applyProjection`, and now covered by a test. Tests: 8 unit tests on the new helper, plus a new `TestHudiPredicatePushdownColumnOrdinals` with 5 end-to-end tests through `createPageSource` over a synthetic base file, covering the stale ordinal, pruning still landing on the right column, a stale ordinal arriving through a dynamic filter, a column added after the base file was written, and agreement between the positional and name-based modes. ### Impact None with `hudi.parquet.use-column-names=true`, the connector default, and none where predicate pushdown is off. With `false`, affected queries stop losing rows and read fewer of them. Two side effects worth naming: a predicate on a column the base file lacks is no longer pushed down at all, and a promoted metastore type now reaches the real column, so positional mode inherits whatever the name-based mode already does with that combination. ### Risk Level low ### Documentation Update none No new or changed config property. `hudi.parquet.use-column-names` already exists and its description is unchanged. ### Contributor's checklist - [x] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute) - [x] Enough context is provided in the sections above - [x] Adequate tests were added if applicable -- 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]
