Skip to content

Conversation

@varun-lakhyani
Copy link
Contributor

@varun-lakhyani varun-lakhyani commented Dec 27, 2025

Description

Implements location overlap validation for SnapshotTableAction to prevent destination table location from overlapping with source table location.

Resolves TODO comment in SnapshotTableSparkAction.java:127 in spark v4.1.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Added unit tests covering snapshot and source location overlap scenarios:
    • Exact same location
    • Source as a subdirectory of destination
    • Destination as a subdirectory of source
    • Completely non-overlapping locations
  • All CI checks pass (31/31)

Checklist

  • Implementation follows existing code patterns and Iceberg contribution guidelines
  • Code compiles without errors
  • Test coverage added
  • No breaking changes to public APIs

…ng destination table location from overlaping source table location. Resolves TODO comment in SnapshotTableSparkAction.java for spark v4.1
…ng destination table location from overlaping source table location. Resolves TODO comment in SnapshotTableSparkAction.java for spark v4.1
@github-actions github-actions bot added the spark label Dec 27, 2025
…ng destination table location from overlaping source table location. Resolves TODO comment in SnapshotTableSparkAction.java for spark v4.1
@RussellSpitzer
Copy link
Member

Definitely needs a test case, not sure why windows would make testing impossible since our locations are stored as strings

@RussellSpitzer
Copy link
Member

Iceberg errors follow this format

"Cannot X because Y (possibly fix Z)"

So in this case

Cannot create a snapshot at location ... because it would overlap with source table ... Overlapping snapshot and source would ....

@varun-lakhyani
Copy link
Contributor Author

@RussellSpitzer

Iceberg errors follow this format

"Cannot X because Y (possibly fix Z)"

So in this case

Cannot create a snapshot at location ... because it would overlap with source table ... Overlapping snapshot and source would ....

Thanks for the feedback.
Added unit tests covering overlapping snapshot and source locations (same path, parent/child cases, and non-overlapping paths) and have updated the error message to follow the Iceberg format.

All CI checks are passing now.

@varun-lakhyani
Copy link
Contributor Author

varun-lakhyani commented Dec 31, 2025

Iceberg errors follow this format

"Cannot X because Y (possibly fix Z)"

So in this case

Cannot create a snapshot at location ... because it would overlap with source table ... Overlapping snapshot and source would ....

@RussellSpitzer
I have addressed all your feedback - added tests and updated error formatting.
All CI checks passing. Would appreciate a review when you are available, Happy to make any changes if required.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants