cloud-fan commented on code in PR #37851:
URL: https://github.com/apache/spark/pull/37851#discussion_r969163315
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Canonicalize.scala:
##########
@@ -28,43 +28,12 @@ object Canonicalize {
e: Expression,
f: PartialFunction[Expression, Seq[Expression]]): Seq[Expression] = e
match {
case c if f.isDefinedAt(c) => f(c).flatMap(gatherCommutative(_, f))
- case other => reorderCommutativeOperators(other) :: Nil
+ case other => other.canonicalized :: Nil
}
/** Orders a set of commutative operations by their hash code. */
- private def orderCommutative(
+ def orderCommutative(
e: Expression,
f: PartialFunction[Expression, Seq[Expression]]): Seq[Expression] =
gatherCommutative(e, f).sortBy(_.hashCode())
-
- def reorderCommutativeOperators(e: Expression): Expression = e match {
- // TODO: do not reorder consecutive `Add`s or `Multiply`s with different
`failOnError` flags
Review Comment:
we need to keep this TODO somewhere.
--
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]