ygjia commented on code in PR #7187:
URL: https://github.com/apache/kyuubi/pull/7187#discussion_r2596978780


##########
extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/ranger/RangerSparkExtension.scala:
##########
@@ -45,6 +45,7 @@ class RangerSparkExtension extends (SparkSessionExtensions => 
Unit) {
 
   override def apply(v1: SparkSessionExtensions): Unit = {
     v1.injectCheckRule(AuthzConfigurationChecker)
+    v1.injectCheckRule(RuleFunctionAuthorization)

Review Comment:
   During the injectOptimizerRule stage, some UDFs may be optimized away, which 
can prevent permission control. For example, in the SQL:
   ```
   SELECT my_to_upper("AaaAe") AS col_upper, my_constant() AS col_constant;
   ```
   
   Here, my_to_upper converts a string to uppercase, and my_constant returns a 
constant value. Using injectCheckRule, these two UDFs can be detected, 
   
   ```
   Project [HiveSimpleUDF#xxx.xxx.hive.custom.ToUpperCaseUDF(AaaAe) AS 
col_upper#4, HiveSimpleUDF#xxx.xxx.hive.custom.ConstantUDF() AS col_constant#5]
   +- OneRowRelation
   ```
   <img width="906" height="236" alt="image" 
src="https://github.com/user-attachments/assets/c45cb55e-e07a-4f92-b8c0-ee0309999dc1";
 />
   
   
   
   but during the injectOptimizerRule stage, they will be optimized to their 
resulting values.
   ```
   Project [AAAAE AS col_upper#4, 10086 AS col_constant#5]
   +- OneRowRelation
   ```
   <img width="650" height="270" alt="image" 
src="https://github.com/user-attachments/assets/1519bc83-7bcc-45a2-a0b9-8a8c903a03a0";
 />
   



-- 
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]

Reply via email to