Core, Spark: RewriteTablePath support for multiple source and destination prefixes - #14355
Core, Spark: RewriteTablePath support for multiple source and destination prefixes#14355krisnaru wants to merge 1 commit into
Conversation
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions. |
|
This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time. |
|
@anuragmantri can you help get eyes on this PR? |
|
I think this is a useful feature for users who have moved the data / metadata locations during the life of a table. |
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions. |
9a44459 to
414eb87
Compare
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions. |
a56c1d8 to
0c7a2f0
Compare
0c7a2f0 to
e76df8e
Compare
uros-b
left a comment
There was a problem hiding this comment.
cc @krisnaru regarding #17521 (review)
What changed
RewriteTablePathtoday accepts a singlesource → targetlocation prefix.This PR generalizes it to support multiple prefix mappings in one run, so a table whose files live under more than one prefix (e.g. data under one bucket/path and metadata under another) can be relocated in a single action.
API
rewriteLocationPrefix(sourcePrefix, targetPrefix)can now be called multiple times — each call registers one mapping:For every path, the longest matching source prefix wins (RewriteTablePathUtil.lookupPrefixMappings), so overlapping prefixes resolve deterministically. A path that matches no mapping fails fast with a clear error.
Implementation
Map<String,String> prefixMappings. The previous single-prefix public methods
(replacePaths, rewriteManifestList, stagingPath, newPath, …) are retained as backward-compatible overloads that delegate to the map-based versions, so existing callers keep working.
Scope
Multi-prefix support is exposed in Spark 4.1 only for now. Spark 3.5 and 4.0
are unchanged and continue to compile/behave exactly as before (they use the
retained single-prefix overloads). Porting the action to 3.5/4.0 can follow up.
Testing