Don't show unsupported AUTHORIZATION ROLE in Hive schema#14285
Conversation
There was a problem hiding this comment.
"supportsRoles" (plural)?
also, this should be used in default implementations of all other role-related methods.
plugin/trino-hive/src/test/resources/io/trino/plugin/hive/security.json
Outdated
Show resolved
Hide resolved
c1038f5 to
0afe70e
Compare
There was a problem hiding this comment.
I don't like it. Maybe we should have AccessControlMetadata to be bound as Optional?
There was a problem hiding this comment.
I think it exposes some issue in the engine. If engine controls ownership elsewhere it should not even ask connector for the owner.
There was a problem hiding this comment.
It seems it didn't expose engine issues as CI is green. io.trino.metadata.MetadataManager#getSchemaOwner doesn't call this method when the security management is SYSTEM. Is there other logic I should confirm?
There was a problem hiding this comment.
I think I get it now, it is about using allow-all so you now don't return the owner of the schema in such case.
I am not sure if it is the way to go. Support of roles and ownership could be seen independent from each other. I mean returning role as owner would seem odd, but returning an user sounds ok.
Should we move this method implementation to AccessControlMetadata?
What about owner for table and view?
There was a problem hiding this comment.
Moved to AccessControlMetadata. SHOW CREATE table and view don't show the owner if my understanding is correct.
There was a problem hiding this comment.
I know, but it is more about the logical ownership. The thing that schema owner is used today should define the actual design decision.
0afe70e to
eb179b0
Compare
eb179b0 to
36b53f4
Compare
|
Just rebased on upstream. |
|
Have we considered going the opposite direction and instead adding support for setting the owner directly during create schema? |
| */ | ||
| default Optional<HivePrincipal> getSchemaOwner(ConnectorSession session, String schemaName) | ||
| { | ||
| return Optional.empty(); |
There was a problem hiding this comment.
Should this throw in the default implementation?
Looks like all other methods do throw by default.
|
Ci seems to fail. PTAL https://github.com/trinodb/trino/actions/runs/3410817080/jobs/5674773042#step:4:348 and |
Description
Don't show unsupported
AUTHORIZATION ROLEproperty inSHOW CREATE SCHEMAresult when the access control doesn't support roles in Hive connector.Fixes #8817
Release notes
( ) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
(x) Release notes are required, with the following suggested text: