Repository navigation
[spark] Record the target external path for data files copied by sys.copy - #11448
Merged
JingsongLi merged 1 commit intoNov 27, 2026
Merged
Conversation
Closed
2 tasks done
Contributor
Author
|
Thank you @JingsongLi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
close #11447
sys.copywrites each data file to the path chosen by the target table, which is the target's external directory when the target setsdata-file.external-paths.CopyFilesUtil.toNewDataFileMetastill derived the newexternalPathfrom the source file's external directory. Whenever the source or the target used external paths, the committed meta pointed to a file that did not exist.The copied meta now records the target path when the target factory writes to an external path, and no external path otherwise. #11248 made the same change for index files. The unused
externalPathDirhelper is removed.Tests
CopyFilesProcedureTest"data files and external paths": copies between tables with external paths on the target only, the source only, and both, then checks each copied meta and reads the target. It fails on master.CopyFilesUtilTest#testCopiedDataFileTakesTheExternalPathOfTheTarget: a source file with an external path keeps the target path when copied to an external target, and none when copied to a bucket directory.