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

Fix create schema in glue catalog when username contains uppercase character #16123

Closed
wants to merge 1 commit into from

Conversation

krvikash
Copy link
Contributor

@krvikash krvikash commented Feb 15, 2023

Description

Fixes #16116

TrinoPrincipal sets the owner name in lowercase always. So, while comparing the principal name
with session user name ignore the case.

Release notes

(X) Release notes are required, with the following suggested text:

# Section
* Fix create schema in glue catalog when username contains uppercase character. ({issue}`16123`)

TrinoPrincipal sets the owner name in lowercase. So, while comparing the principal name
with session user name ignore the case.
@cla-bot cla-bot bot added the cla-signed label Feb 15, 2023
@@ -256,7 +256,7 @@ public Optional<TrinoPrincipal> getNamespacePrincipal(ConnectorSession session,
public void createNamespace(ConnectorSession session, String namespace, Map<String, Object> properties, TrinoPrincipal owner)
{
checkArgument(owner.getType() == PrincipalType.USER, "Owner type must be USER");
checkArgument(owner.getName().equals(session.getUser()), "Explicit schema owner is not supported");
checkArgument(owner.getName().equalsIgnoreCase(session.getUser()), "Explicit schema owner is not supported");
Copy link
Member

@ebyhr ebyhr Feb 15, 2023

Choose a reason for hiding this comment

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

@arhimondr @sopel39 Do you remember why TrinoPrincipal lowercase name argument #90? Username is case sensitive in my understanding #16124

@krvikash
Copy link
Contributor Author

Closing. This is a duplicate of #16124.

@krvikash krvikash closed this Feb 16, 2023
@krvikash krvikash deleted the fix-trino-16116 branch February 16, 2023 11:00
@ebyhr
Copy link
Member

ebyhr commented Feb 17, 2023

Not a "duplicate" because the approach differs. I'm not sure if my PR is better than this change.

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