Skip to content

Conversation

@HonahX
Copy link
Contributor

@HonahX HonahX commented Jan 7, 2026

Fixes: #3379
Currently, when updating write.data.path of the table to a subdir under the table location, it will fail the location overlap check. For example

spark-sql> ALTER TABLE tb1 SET TBLPROPERTIES (
  'write.data.path' = '<tableLocation>/alternative_data'
);

org.apache.iceberg.exceptions.ForbiddenException: Forbidden: Unable to create table at location 's3://<table_location>' because it conflicts with existing table or namespace at location 's3://<table_location>`

IcebergCatalog.validateNoLocationOverlap(...) constructs a virtual PolarisEntity for overlap checking, but it did not set the entity name. When fetching the siblings of the table, it fails to filter out itself and thus the check mistaken considered that the write.data.path conflict with the table's own base location. (isChildOf)

This PR fix the issue by adding name to the virtual PolarisEntity and add a unit and a integration test.

Note

This PR only fixes the default code path where OPTIMIZED_SIBLING_CHECK is false. There are more issues(#3378) in the optimized one therefore they should be in a separate PR.

Checklist

  • 🛡️ Don't disclose security issues! (contact [email protected])
  • 🔗 Clearly explained why the changes are needed, or linked related issues: Fixes #
  • 🧪 Added/updated tests with good coverage, or manually tested (and explained how)
  • 💡 Added comments for complex logic
  • 🧾 Updated CHANGELOG.md (if needed)
  • 📚 Updated documentation in site/content/in-dev/unreleased (if needed)

@github-project-automation github-project-automation bot moved this to PRs In Progress in Basic Kanban Board Jan 7, 2026
@HonahX HonahX changed the title [Fix] Allow setting write.data.path to be a subdirectory of the table location [Bug] Fix an error thrown when setting write.data.path to be a subdirectory of the table location Jan 7, 2026
@HonahX HonahX changed the title [Bug] Fix an error thrown when setting write.data.path to be a subdirectory of the table location [Bug] Fix a bug that causing error when setting write.data.path to be a subdirectory of the table location Jan 7, 2026
@HonahX HonahX marked this pull request as ready for review January 7, 2026 22:40
Copy link
Contributor

@dimas-b dimas-b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Thanks for the fix, @HonahX !

@github-project-automation github-project-automation bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Jan 7, 2026
Copy link
Contributor

@flyrain flyrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 Thanks @HonahX for the fix!

@HonahX HonahX merged commit d55a180 into apache:main Jan 7, 2026
15 checks passed
@github-project-automation github-project-automation bot moved this from Ready to merge to Done in Basic Kanban Board Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot set write.data.path to a subdirectory under the current table location OPTIMIZED_SIBLING_CHECK=true

3 participants