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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]