zhuxiangyi commented on code in PR #8334: URL: https://github.com/apache/paimon/pull/8334#discussion_r3473183682
########## paimon-core/src/main/java/org/apache/paimon/operation/DataEvolutionSplitRead.java: ########## Review Comment: Thanks for the review! Agreed — the nested-data-evolution assembly is what grew `createUnionReader`. Plan: extract the planning logic (leaf-level matching + the tree-shaped assembly plan, the current Steps 1–4 plus the `collectLeafIds`/`providerOf`/`findSubProvider` helpers) into a dedicated, pure `DataEvolutionReadPlanner` that returns an immutable plan (`rowOffsets`/`fieldOffsets`/`NestedField[]` + the per-bunch read fields). `createUnionReader` then just resolves the bunch schemas and builds the readers from that plan, so it goes back to a thin shell. A nice side effect is that the planning logic becomes directly unit-testable instead of only through ITs. For the broader pre-existing `TODO: Optimize implementation of this class` (the top-level read path, `mergeRangesAndSort`, etc.), I'd suggest keeping that as a separate follow-up PR so this one stays focused on the nested feature — and I'd be happy to take part in that optimization PR as well. Does this approach sound good to you? -- 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]
