Skip to content
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

Add a procedure to alter table location in Hive #8908

Closed
wants to merge 2 commits into from

Conversation

ebyhr
Copy link
Member

@ebyhr ebyhr commented Aug 18, 2021

Fixes #8516

I have a little concern about the security, how verify the new location's permission.

@kokosing
Copy link
Member

How about we introduce syntax for this like ALTER TABLE example_table SET location = 's4://brand/new/location'? location is a hive table property and having standard way to alter table properties sounds like reasonable. Adding syntax is not that difficult, we could also add related access control methods so your security concerns could be addressed.

While doing this we would also need to think how syntax for altering schema and columns properties would look like too.

ALTER SCHEMA example_schema SET location = 's4://brand/new/location' ?
ALTER COLUMN example_table.example_column SET primary_key = true ?

CC: @martint

@tooptoop4
Copy link
Contributor

need a way to disable this otherwise creating a table that points to an existing s3 location that contains sensitive data would circumvent table controls

@findepi
Copy link
Member

findepi commented Aug 23, 2021

creating a table that points to an existing s3 location that contains sensitive data would circumvent table controls

good point.

same as in register_partition procedure,

if (!allowRegisterPartition) {
throw new TrinoException(PERMISSION_DENIED, "register_partition procedure is disabled");

@ebyhr ebyhr force-pushed the ebi/alter-table-location branch from 5fcf55f to 2649268 Compare September 14, 2021 02:31
@ebyhr
Copy link
Member Author

ebyhr commented Sep 14, 2021

Added hive.allow-alter-table-location-procedure config property anyway though the syntax isn't yet decided.

@ebyhr
Copy link
Member Author

ebyhr commented Oct 14, 2021

Going to close this PR because this should be handled in ALTER TABLE SET PROPERTIES statement.

@ebyhr ebyhr closed this Oct 14, 2021
@ebyhr ebyhr deleted the ebi/alter-table-location branch October 14, 2021 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Support Altering external table location
4 participants