-
Notifications
You must be signed in to change notification settings - Fork 3k
Spark: Add location overlap validation for SnapshotTableAction #14933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
pvary
merged 11 commits into
apache:main
from
varun-lakhyani:implement-snapshot-location-overlap-check
Jan 10, 2026
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
bf0ee55
Add Location overlap validation for SnapshotTableSparkAction preventi…
varun-lakhyani 68c1a8c
Add Location overlap validation for SnapshotTableSparkAction preventi…
varun-lakhyani 5c54330
Add Location overlap validation for SnapshotTableSparkAction preventi…
varun-lakhyani 5671a8a
Fix snapshot location overlap error message
varun-lakhyani 712c9bd
Fix snapshot location overlap error message
varun-lakhyani 3beb3b1
Add test for overlapping snapshot and source locations
varun-lakhyani 1a3dcf0
Validate snapshot destination and source overlap prior to staging
varun-lakhyani dae2084
Fix snapshot location path construction in overlap tests
varun-lakhyani fb9e76d
Fix snapshot location path construction in overlap tests
varun-lakhyani a365b1f
Rename variables and separate non-overlapping tests
varun-lakhyani de3107b
Remove Hadoop Path dependency
varun-lakhyani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we don't test with hadoop?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hadoop doesn't allow custom destination location via .tableLocation() when done this it fails even before the check while
StagedSparkTable stagedTable = stageDestTable();Error Message:
TestSnapshotTableAction > testSnapshotWithOverlappingLocation() > catalogName = testhadoop, implementation = org.apache.iceberg.spark.SparkCatalog, config = {type=hadoop, cache-enabled=false} FAILED java.lang.IllegalArgumentException: Cannot set a custom location for a path-based table. Expected file:/tmp/warehouse62334905503302693.tmp/default/table but got /tmp/junit-17415081344650343329/newJunit10343828823716601592because of HadoopCatalog withLocation() check
public TableBuilder withLocation(String location) { Preconditions.checkArgument( location == null || location.equals(defaultLocation), "Cannot set a custom location for a path-based table. Expected " + defaultLocation + " but got " + location); return this; }So, when we can't give custom location and TestBase predefine the warehouse using which hadoop always derives non-overlapping location the test seems useless unless we change the warehouse.
For the same reason I skipped Hadoop catalog for the tests including .tableLocation().
Do let me know If I should think otherwise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Best to just add a note here, "//Hadoop Catalogs do not Support Custom Table Locations"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in latest commit