aokolnychyi commented on code in PR #9873:
URL: https://github.com/apache/iceberg/pull/9873#discussion_r1513348794
##########
spark/v3.5/spark-extensions/src/main/scala/org/apache/spark/sql/catalyst/optimizer/ReplaceStaticInvoke.scala:
##########
@@ -40,21 +48,39 @@ import org.apache.spark.sql.types.StructType
object ReplaceStaticInvoke extends Rule[LogicalPlan] {
override def apply(plan: LogicalPlan): LogicalPlan =
- plan.transformWithPruning (_.containsAllPatterns(BINARY_COMPARISON,
FILTER)) {
- case filter @ Filter(condition, _) =>
- val newCondition =
condition.transformWithPruning(_.containsPattern(BINARY_COMPARISON)) {
- case c @ BinaryComparison(left: StaticInvoke, right) if
canReplace(left) && right.foldable =>
- c.withNewChildren(Seq(replaceStaticInvoke(left), right))
-
- case c @ BinaryComparison(left, right: StaticInvoke) if
canReplace(right) && left.foldable =>
- c.withNewChildren(Seq(left, replaceStaticInvoke(right)))
- }
-
- if (newCondition fastEquals condition) {
- filter
- } else {
- filter.copy(condition = newCondition)
- }
+ plan.transformWithPruning (_.containsAnyPattern(COMMAND, FILTER, JOIN)) {
Review Comment:
Note `containsAllPatterns` became `containsAnyPattern`. I don't anticipate
this being a performance problem, however.
--
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]