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 2022/12/09 17:58:00 UTC
[jira] [Commented] (IMPALA-11769) Difference in required privileges to execute a UDF in a SELECT query between Impala and Hive
[ https://issues.apache.org/jira/browse/IMPALA-11769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17645424#comment-17645424 ]
ASF subversion and git services commented on IMPALA-11769:
----------------------------------------------------------
Commit 4cbc295c48de1b369a78ec266137dfc3b363e7ec in impala's branch refs/heads/master from Fang-Yu Rao
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=4cbc295c4 ]
IMPALA-10986: Require the SELECT privilege to execute a UDF
This patch registers the SELECT privilege on a UDF during query analysis
for a SELECT query that attempts to execute the UDF. Only the required
privileges for UDF execution are changed. The required privileges
for queries like CREATE/DROP FUNCTION or SHOW FUNCTIONS remain the same.
More precisely, before this patch, to execute a UDF, a user only had to
be granted any of the SELECT, INSERT, REFRESH privileges on all the
tables, columns in the database where the UDF belongs to.
After this patch, the user has to be granted the SELECT privilege on the
UDF as well to execute the UDF. Note that currently in Hive, only the
SELECT privilege on the UDF is required when Ranger is the authorization
provider. IMPALA-11769 was also created to keep track of the difference
in the required privileges between Impala and Hive.
To facilitate managing privileges on UDF's, this patch also adds the
keyword 'USER_DEFINED_FN'. For instance, we could use the following
statement to grant the SELECT privilege on the UDF <udf_name> under the
database <db_name> to the user <user_name>.
GRANT SELECT ON USER_DEFINED_FN <db_name>.<udf_name> TO USER <user_name>
A wildcard in the name of a UDF is also supported. If an administrator
wants to grant to a user only the SELECT privilege on all the tables,
columns but not all the UDF's in a database, after executing "GRANT
SELECT ON DATABASE <db_name> TO USER <user_name>", the following could
be done to revoke the SELECT privilege on all the UDF's in the database
<db_name> from the user <user_name>.
REVOKE SELECT ON USER_DEFINED_FN <db_name>.`*` FROM USER <user_name>
Testing:
- Added various FE and E2E tests to verify Impala's behavior with
respect to UDF execution.
- Verified that this patch passes the core tests in the DEBUG build.
Change-Id: I5e58ba30545ce169786aac279b00c8f6e09ae740
Reviewed-on: http://gerrit.cloudera.org:8080/19194
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
> Difference in required privileges to execute a UDF in a SELECT query between Impala and Hive
> --------------------------------------------------------------------------------------------
>
> Key: IMPALA-11769
> URL: https://issues.apache.org/jira/browse/IMPALA-11769
> Project: IMPALA
> Issue Type: Task
> Reporter: Fang-Yu Rao
> Assignee: Fang-Yu Rao
> Priority: Major
>
> After IMPALA-10986, to execute a UDF of a database in a SELECT query, a user is required to additionally have the SELECT privilege on the UDF beside any of INSERT, REFRESH, SELECT on the database. The requirement is a bit different from that in Hive when Ranger is the authorization provider in that Hive's Ranger plugin *only* requires the user to have the SELECT privilege on the UDF.
> We should decide whether we would like to change Impala's behavior with respect to UDF execution in a SELECT query so that Impala and Hive would have the same required privilege.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org