Skip to content

REVOKE GRANT OPTION FOR should revoke only GRANT OPTION#10094

Merged
Praveen2112 merged 5 commits intotrinodb:masterfrom
Praveen2112:praveen/hive_sql_std_access
Dec 3, 2021
Merged

REVOKE GRANT OPTION FOR should revoke only GRANT OPTION#10094
Praveen2112 merged 5 commits intotrinodb:masterfrom
Praveen2112:praveen/hive_sql_std_access

Conversation

@Praveen2112
Copy link
Copy Markdown
Member

No description provided.

@cla-bot cla-bot bot added the cla-signed label Nov 29, 2021
Copy link
Copy Markdown
Member

@kokosing kokosing left a comment

Choose a reason for hiding this comment

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

Please add more test cases. When you revoke and then grant again for example.

See https://www.postgresql.org/docs/14/sql-revoke.html which follows:

If the privilege or the grant option held by the first user is being revoked and dependent privileges exist, those dependent privileges are also revoked if CASCADE is specified

Please add tests around this case to concrete the Hive behavior.

@MiguelWeezardo
Copy link
Copy Markdown
Member

Do we plan a fallback for Hive metastores older than 0.14.0?

Copy link
Copy Markdown
Member

@MiguelWeezardo MiguelWeezardo Nov 29, 2021

Choose a reason for hiding this comment

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

I suggest also testing the inverse - adding the GRANT OPTION back to the privilege once it was removed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is not supported by HiveMetastore directly - will be addressing them in a different PR.

@Praveen2112 Praveen2112 force-pushed the praveen/hive_sql_std_access branch 2 times, most recently from dd668aa to 47c2109 Compare December 2, 2021 09:09
@Praveen2112 Praveen2112 marked this pull request as ready for review December 2, 2021 09:25
@Praveen2112
Copy link
Copy Markdown
Member Author

@MiguelWeezardo @kokosing AC

Copy link
Copy Markdown
Member

@kokosing kokosing left a comment

Choose a reason for hiding this comment

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

Looks good % comments

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What should happen if it is not successful? Show we retry or fail? Do we check that? I don't see any check for this in io.trino.plugin.hive.metastore.thrift.ThriftHiveMetastore#revokeTablePrivileges

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do we need this change at all? Is it only for symmetry with revokePrivileges?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Why do we need this change at all

Client#grant_privileges is deprecated so we move to the new API. And yet it would be symmetric with revokePrivileges.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Show we retry or fail.
We retry in case of any failures.

But here we just leave it as it is. Like we do for dropPartitions

@kokosing kokosing requested a review from ksobolew December 2, 2021 10:33
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do we need this change at all? Is it only for symmetry with revokePrivileges?

@Praveen2112 Praveen2112 force-pushed the praveen/hive_sql_std_access branch from 47c2109 to 540cd6b Compare December 2, 2021 12:39
@Praveen2112
Copy link
Copy Markdown
Member Author

@kokosing AC

@Praveen2112 Praveen2112 force-pushed the praveen/hive_sql_std_access branch from 540cd6b to 5b5fa80 Compare December 2, 2021 16:42
@Praveen2112 Praveen2112 requested a review from losipiuk December 3, 2021 03:02
@Praveen2112 Praveen2112 merged commit 3df2371 into trinodb:master Dec 3, 2021
@Praveen2112 Praveen2112 mentioned this pull request Dec 3, 2021
12 tasks
@github-actions github-actions bot added this to the 365 milestone Dec 3, 2021
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.

4 participants