saihemanth-cloudera commented on code in PR #3821:
URL: https://github.com/apache/hive/pull/3821#discussion_r1037817687
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java:
##########
@@ -12550,6 +12550,21 @@ private ParseResult
rewriteASTWithMaskAndFilter(TableMask tableMask, ASTNode ast
}
}
+ void gatherUserSuppliedFunctions(ASTNode ast) {
+ int tokenType = ast.getToken().getType();
+ if (tokenType == HiveParser.TOK_FUNCTION ||
+ tokenType == HiveParser.TOK_FUNCTIONDI ||
+ tokenType == HiveParser.TOK_FUNCTIONSTAR) {
+ if (ast.getChild(0).getType() == HiveParser.Identifier) {
+ // maybe user supplied
+ this.userSuppliedFunctions.add(ast.getChild(0).getText());
Review Comment:
I think this is the way to set field variables into the semantic analyzer
object. Only then I can retrieve it in the `CommandAuthorizerV2` class
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java:
##########
@@ -12550,6 +12550,21 @@ private ParseResult
rewriteASTWithMaskAndFilter(TableMask tableMask, ASTNode ast
}
}
+ void gatherUserSuppliedFunctions(ASTNode ast) {
+ int tokenType = ast.getToken().getType();
+ if (tokenType == HiveParser.TOK_FUNCTION ||
+ tokenType == HiveParser.TOK_FUNCTIONDI ||
+ tokenType == HiveParser.TOK_FUNCTIONSTAR) {
+ if (ast.getChild(0).getType() == HiveParser.Identifier) {
+ // maybe user supplied
Review Comment:
Ack
##########
ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java:
##########
@@ -1438,6 +1442,10 @@ public void setUpdateColumnAccessInfo(ColumnAccessInfo
updateColumnAccessInfo) {
this.updateColumnAccessInfo = updateColumnAccessInfo;
}
+ public Set<String> getUserSuppliedFunctions() {
Review Comment:
Ack
##########
common/src/java/org/apache/hadoop/hive/conf/HiveConf.java:
##########
@@ -3599,6 +3599,9 @@ public static enum ConfVars {
HIVE_AUTHORIZATION_TABLES_ON_STORAGEHANDLERS("hive.security.authorization.tables.on.storagehandlers",
true,
"Enables authorization on tables with custom storage handlers as
implemented by HIVE-24705. " +
"Default setting is true. Useful for turning the feature off if the
corresponding ranger patch is missing."),
+
HIVE_AUTHORIZATION_FUNCTIONS_IN_VIEW("hive.security.authorization.functions.in.view",
true, "" +
Review Comment:
Ack
--
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]