Skip to content

Commit

Permalink
[KYUUBI #5997][AUTHZ] Avoid unnecessary loop of RuleEliminateTypeOf
Browse files Browse the repository at this point in the history
# 🔍 Description
## Issue References 🔗

This pull request fixes #5997

## Describe Your Solution 🔧
Avoid unnecessary loop of RuleEliminateTypeOf, improve the catalyst performance

## Types of changes 🔖

- [ ] 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 ⚰️

#### Behavior With This Pull Request 🎉

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

1db3b5f [Angerszhuuuu] [KYUUBI #5997][Improvement] Avoid unnecessary loop of RuleEliminateTypeOf

Authored-by: Angerszhuuuu <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
  • Loading branch information
AngersZhuuuu authored and pan3793 committed Jan 19, 2024
1 parent 162e72b commit 35d9b20
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}

0 comments on commit 35d9b20

Please sign in to comment.