shangxinli opened a new pull request, #20333: URL: https://github.com/apache/hudi/pull/20333
### Describe the issue this Pull Request addresses Part of #18135 (REGISTER_ONLY bootstrap). Today a FILES partition entry is just a file name, resolved against the table's partition path, so the metadata table can only ever address files it owns. Registering existing files in place needs a way to say where a file actually lives. ### Summary and Changelog Adds an optional `sourcePartitionPath` to `HoodieMetadataFileInfo`: the absolute directory a file lives in, when that is not under the table. When set, `getFileList` resolves the file name against it instead of the table's partition path; when null (every file written today) nothing changes. - `HoodieMetadata.avsc`: new nullable `sourcePartitionPath` field, default null. - `HoodieMetadataPayload`: new `createPartitionFilesRecord` overload taking file -> source partition path; existing overload delegates with an empty map. - `HoodieTableMetadataUtil`: merging two file infos keeps whichever source partition path is set. - `HoodieWriteStat`: new nullable `sourcePartitionPath`, plumbed into the FILES records by `FilesIndexer`, and added to `HoodieWriteStat` in `HoodieCommitMetadata.avsc` so it survives the Jackson conversion into commit metadata. - Reading it goes through `getNestedFieldValue`, since `GenericRecord#get` throws on a field the record's schema does not have. Nothing in the tree sets it yet; the bootstrap write path that does is the next PR. ### Impact None for existing tables. The field is optional with a null default, so old readers skip it and new readers see null on old records. ### Risk Level low Unit tests cover resolution with and without the field set, merge, and reading a record written against the pre-change schema. ### Documentation Update none ### 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]
