Skip to content

[Server] Reject cloud storage roots for external data - #1726

Merged
yili-db merged 3 commits into
unitycatalog:mainfrom
timothyw553:fix/reject-root-data-locations
Jul 29, 2026
Merged

yili-db merged 3 commits into
unitycatalog:mainfrom
timothyw553:fix/reject-root-data-locations

Conversation

@timothyw553

@timothyw553 timothyw553 commented Jul 28, 2026 •

Copy link
Copy Markdown
Collaborator

PR Checklist

  • A description of the changes is added to the description of this PR.
  • If there is a related issue, make sure it is linked to this PR.
  • If you have fixed a bug or added code that should be tested, add tests!
  • If you have added or modified a feature, documentation in docs is updated. (Not applicable: validation-only bug fix.)

Description of changes

Reject bucket- or container-root storage locations when creating external tables and volumes. Cloud roots remain valid for external-location coverage and server storage configuration.

The validation operates on the decoded normalized path, so equivalent root forms such as trailing slashes, normalized dot segments, and encoded slashes are handled consistently across S3, GCS, ABFS, and ABFSS.

Testing

  • build/sbt "server/Compile/javafmtAll" "server/Test/javafmtAll"
  • build/sbt "server/testOnly io.unitycatalog.server.utils.NormalizedURLTest io.unitycatalog.server.sdk.tables.SdkTableCRUDTest io.unitycatalog.server.sdk.volume.SdkVolumeCRUDTest" "server/checkstyle" "server/Test/checkstyle"
  • 31 targeted tests passed; checkstyle reported no issues.

storageLocation = NormalizedURL.from(createTable.getStorageLocation());
ValidationUtils.checkArgument(
!storageLocation.isCloudStorageRoot(),
"External table storage location must include a non-empty path prefix");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

consider echoing back the input location to help debugging.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@yili-db

yili-db commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

As defense-in-depth, I think it should also check when vending a storage credential.

@timothyw553
timothyw553 force-pushed the fix/reject-root-data-locations branch from db3f1cd to 93b9221 Compare July 29, 2026 06:42
@yili-db
yili-db merged commit a10bf77 into unitycatalog:main Jul 29, 2026
16 checks passed
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.

2 participants