snuyanzin commented on code in PR #25388: URL: https://github.com/apache/flink/pull/25388#discussion_r1774177868
########## flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/utils/FlinkRexUtil.scala: ########## @@ -439,17 +439,16 @@ object FlinkRexUtil { }) private class EquivalentExprShuttle(rexBuilder: RexBuilder) extends RexShuttle { - private val equiExprMap = mutable.HashMap[String, RexNode]() + private val equiExprSet = mutable.HashSet[RexNode]() override def visitCall(call: RexCall): RexNode = { call.getOperator match { case EQUALS | NOT_EQUALS | GREATER_THAN | LESS_THAN | GREATER_THAN_OR_EQUAL | LESS_THAN_OR_EQUAL => - val swapped = swapOperands(call) - if (equiExprMap.contains(swapped.toString)) { - swapped + if (equiExprSet.contains(call)) { Review Comment: For Calcite `>($1, $2)` and `<($2, $1)` are equal, same for others this fact could be used here. Ideally we could reuse Calcite's RexNormalize however it will lead to large plan related changes, may be makes sense to do it with separate PR/jira -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org