You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2018/10/13 03:28:00 UTC

[jira] [Commented] (IMPALA-7701) Grant option always shows as NULL in SHOW GRANT ROLE/USER for any HS2 clients

    [ https://issues.apache.org/jira/browse/IMPALA-7701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16648718#comment-16648718 ] 

ASF subversion and git services commented on IMPALA-7701:
---------------------------------------------------------

Commit a80ec4a6d987464352e8f7da89110151569a5a64 in impala's branch refs/heads/master from [~fredyw]
[ https://git-wip-us.apache.org/repos/asf?p=impala.git;h=a80ec4a ]

IMPALA-7701: grant_option in SHOW GRANT always returns NULL from HS2 clients

Prior to this patch, SHOW GRANT ROLE/USER always showed NULL in
grant_option column because the grant_option column header was set
to use BOOLEAN type but the column value was set to use STRING.
This mismatch causes HS2 clients to interpret the column value as
not set (NULL). The patch fixes the issue by setting the grant_option
column value to use BOOLEAN value. The patch also renames
test_show_grant_user.py to test_show_grant.py for all tests related to
SHOW GRANT statements.

Testing:
- Ran all FE tests
- Added new E2E test running SHOW GRANT statements from HS2 client
- Ran all E2E authorization tests

Change-Id: I1e175544172b63d36dceedc61e1f47e0f910d7cf
Reviewed-on: http://gerrit.cloudera.org:8080/11663
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


> Grant option always shows as NULL in SHOW GRANT ROLE/USER for any HS2 clients
> -----------------------------------------------------------------------------
>
>                 Key: IMPALA-7701
>                 URL: https://issues.apache.org/jira/browse/IMPALA-7701
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Frontend
>    Affects Versions: Impala 3.0, Impala 2.12.0
>            Reporter: Fredy Wijaya
>            Assignee: Fredy Wijaya
>            Priority: Major
>             Fix For: Impala 3.1.0
>
>
> In Impala shell:
> {noformat}
> [localhost:21000] default> show grant user test_user;
> Query: show grant user test_user
> +----------------+----------------+----------+----------+-------+--------+-----+-----------+--------------+-------------------------------+
> | principal_type | principal_name | scope    | database | table | column | uri | privilege | grant_option | create_time                   |
> +----------------+----------------+----------+----------+-------+--------+-----+-----------+--------------+-------------------------------+
> | USER           | test_user      | database | foo      |       |        |     | owner     | true         | Thu, Oct 11 2018 11:48:57.186 |
> | ROLE           | admin          | server   |          |       |        |     | all       | false        | Thu, Oct 11 2018 11:48:48.203 |
> +----------------+----------------+----------+----------+-------+--------+-----+-----------+--------------+-------------------------------+
> Fetched 2 row(s) in 0.13s
> [localhost:21000] default> show grant role admin;
> Query: show grant role admin
> +--------+----------+-------+--------+-----+-----------+--------------+-------------------------------+
> | scope  | database | table | column | uri | privilege | grant_option | create_time                   |
> +--------+----------+-------+--------+-----+-----------+--------------+-------------------------------+
> | server |          |       |        |     | all       | false        | Thu, Oct 11 2018 11:48:48.203 |
> +--------+----------+-------+--------+-----+-----------+--------------+-------------------------------+
> Fetched 1 row(s) in 0.01s
> {noformat}
> Using Impyla (HS2 client):
> {noformat}
> >>> from impala.dbapi import connect
> >>> conn = connect(host='localhost', port=21050)
> >>> cursor = conn.cursor()
> >>> cursor.execute('show grant user test_user')
> >>> print(cursor.fetchall())
> [('USER', 'test_user', 'database', 'foo', '', '', '', 'owner', None, 'Thu, Oct 11 2018 11:48:57.186'), ('ROLE', 'admin', 'server', '', '', '', '', 'all', None, 'Thu, Oct 11 2018 11:48:48.203')]
> >>> cursor.execute('show grant role admin')
> >>> print(cursor.fetchall())
> [('server', '', '', '', '', 'all', None, 'Thu, Oct 11 2018 11:48:48.203')]
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org