Hello Quanlong Huang, Abhishek Rawat, Zoltan Borok-Nagy, Csaba Ringhofer,
Impala Public Jenkins,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/23815
to look at the new patch set (#4).
Change subject: IMPALA-14085: Implement GRANT/REVOKE ROLE TO/FROM a user
......................................................................
IMPALA-14085: Implement GRANT/REVOKE ROLE TO/FROM a user
As a follow-up to IMPALA-10211, this patch adds the support for the
following role-related statements.
1. GRANT ROLE <role_name> TO USER <user_name>.
2. REVOKE ROLE <role_name> FROM USER <user_name>.
3. SHOW ROLE GRANT USER <user_name>.
Note that we added an optional bool field 'principal_is_group' to
TGrantRevokeRoleParams that is used to encode the related parameters
for the GRANT/REVOKE ROLE command. We could have distinguished
GRANT/REVOKE ROLE TO/FROM GROUP from GRANT/REVOKE ROLE TO/FROM USER by
checking whether the existing field 'group_names' is null. However,
this would require us to change the field from a required one to an
optional one, which could break the compatibility between impalad and
catalogd during upgrade. In addition, critique-gerrit-review.py
disallows us from changing this field to an optional one.
Testing:
- Extended the test file grant_revoke.test to additionally cover the
scenario in which the grantee/revokee is a user.
- Added an end-to-end test to briefly verify the statements
SHOW ROLE GRANT USER <user_name> and SHOW CURRENT ROLES are working
as expected.
Change-Id: Ie5a16aeb4bbf8637ad326a1ec3d5fce1b196d73f
---
M common/thrift/Frontend.thrift
M common/thrift/JniCatalog.thrift
M fe/src/main/cup/sql-parser.cup
M fe/src/main/java/org/apache/impala/analysis/GrantRevokeRoleStmt.java
M fe/src/main/java/org/apache/impala/analysis/ShowRolesStmt.java
M fe/src/main/java/org/apache/impala/authorization/AuthorizationManager.java
M fe/src/main/java/org/apache/impala/authorization/NoopAuthorizationFactory.java
M
fe/src/main/java/org/apache/impala/authorization/ranger/RangerCatalogdAuthorizationManager.java
M
fe/src/main/java/org/apache/impala/authorization/ranger/RangerImpaladAuthorizationManager.java
M fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java
M fe/src/main/java/org/apache/impala/util/CatalogOpUtil.java
M fe/src/test/java/org/apache/impala/util/CatalogOpUtilTest.java
M testdata/workloads/functional-query/queries/QueryTest/grant_revoke.test
M tests/authorization/test_ranger.py
M tests/common/impala_test_suite.py
15 files changed, 385 insertions(+), 197 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/15/23815/4
--
To view, visit http://gerrit.cloudera.org:8080/23815
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ie5a16aeb4bbf8637ad326a1ec3d5fce1b196d73f
Gerrit-Change-Number: 23815
Gerrit-PatchSet: 4
Gerrit-Owner: Fang-Yu Rao <[email protected]>
Gerrit-Reviewer: Abhishek Rawat <[email protected]>
Gerrit-Reviewer: Csaba Ringhofer <[email protected]>
Gerrit-Reviewer: Fang-Yu Rao <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Quanlong Huang <[email protected]>
Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>