[ 
https://issues.apache.org/jira/browse/HIVE-27116?focusedWorklogId=849476&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-849476
 ]

ASF GitHub Bot logged work on HIVE-27116:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 07/Mar/23 07:15
            Start Date: 07/Mar/23 07:15
    Worklog Time Spent: 10m 
      Work Description: saihemanth-cloudera commented on code in PR #4092:
URL: https://github.com/apache/hive/pull/4092#discussion_r1127446733


##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/function/AbstractFunctionAnalyzer.java:
##########
@@ -66,11 +70,24 @@ protected void addEntities(String functionName, String 
className, boolean isTemp
     }
     if (database != null) {
       outputs.add(new WriteEntity(database, 
WriteEntity.WriteType.DDL_NO_LOCK));
+      // Add the permanent function as a WriteEntity
+      Function function;
+      if (isCreate) {
+        function = new Function(functionName, database.getName(), className,
+                SessionState.getUserFromAuthenticator(), PrincipalType.USER,
+                (int) (System.currentTimeMillis() / 1000), FunctionType.JAVA, 
resources);
+      } else {
+        try {
+          function = db.getFunction(database.getName(), functionName);

Review Comment:
   We need to fetch the function for desc or drop function queries, we need to 
know whether the current user has required permissions by looking at the 
function object.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 849476)
    Time Spent: 1.5h  (was: 1h 20m)

> HS2 need to send owner info for UDFs in the HivePrivilegeObject for 
> authorization
> ---------------------------------------------------------------------------------
>
>                 Key: HIVE-27116
>                 URL: https://issues.apache.org/jira/browse/HIVE-27116
>             Project: Hive
>          Issue Type: Bug
>          Components: HiveServer2, Security
>            Reporter: Sai Hemanth Gantasala
>            Assignee: Sai Hemanth Gantasala
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> UDFs (Functions) of HivePrivilegeObject should have owner info for 
> authorization.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to