This is an automated email from the ASF dual-hosted git repository.

chengpan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new 35d9b2096 [KYUUBI #5997][AUTHZ] Avoid unnecessary loop of 
RuleEliminateTypeOf
35d9b2096 is described below

commit 35d9b20969eecbecb3f9277682b3be0b9441b371
Author: Angerszhuuuu <[email protected]>
AuthorDate: Fri Jan 19 14:35:53 2024 +0800

    [KYUUBI #5997][AUTHZ] Avoid unnecessary loop of RuleEliminateTypeOf
    
    # :mag: Description
    ## Issue References ๐Ÿ”—
    
    This pull request fixes #5997
    
    ## Describe Your Solution ๐Ÿ”ง
    Avoid unnecessary loop of RuleEliminateTypeOf, improve the catalyst 
performance
    
    ## Types of changes :bookmark:
    
    - [ ] Bugfix (non-breaking change which fixes an issue)
    - [ ] New feature (non-breaking change which adds functionality)
    - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
    
    ## Test Plan ๐Ÿงช
    
    #### Behavior Without This Pull Request :coffin:
    
    #### Behavior With This Pull Request :tada:
    
    #### Related Unit Tests
    
    ---
    
    # Checklist ๐Ÿ“
    
    - [ ] This patch was not authored or co-authored using [Generative 
Tooling](https://www.apache.org/legal/generative-tooling.html)
    
    **Be nice. Be informative.**
    
    Closes #5998 from AngersZhuuuu/KYUUBI-5997.
    
    Closes #5997
    
    1db3b5f95 [Angerszhuuuu] [KYUUBI #5997][Improvement] Avoid unnecessary loop 
of RuleEliminateTypeOf
    
    Authored-by: Angerszhuuuu <[email protected]>
    Signed-off-by: Cheng Pan <[email protected]>
---
 .../apache/kyuubi/plugin/spark/authz/rule/RuleEliminateTypeOf.scala | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git 
a/extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/rule/RuleEliminateTypeOf.scala
 
b/extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/rule/RuleEliminateTypeOf.scala
index 0f3ae136c..668f45fbd 100644
--- 
a/extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/rule/RuleEliminateTypeOf.scala
+++ 
b/extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/rule/RuleEliminateTypeOf.scala
@@ -25,10 +25,8 @@ import 
org.apache.kyuubi.plugin.spark.authz.rule.expression.TypeOfPlaceHolder
 
 object RuleEliminateTypeOf extends Rule[LogicalPlan] {
   override def apply(plan: LogicalPlan): LogicalPlan = {
-    plan.transformUp { case p =>
-      p.transformExpressionsUp {
-        case toph: TypeOfPlaceHolder => TypeOf(toph.expr)
-      }
+    plan.transformExpressionsUp {
+      case toph: TypeOfPlaceHolder => TypeOf(toph.expr)
     }
   }
 }

Reply via email to