HyukjinKwon commented on a change in pull request #34883:
URL: https://github.com/apache/spark/pull/34883#discussion_r768251362
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala
##########
@@ -222,6 +222,20 @@ abstract class Expression extends TreeNode[Expression] {
*/
def childrenResolved: Boolean = children.forall(_.resolved)
+ // Return a roughly canonicalized expression, which recursively
canonicalizes each expression node
+ // without changing the structure of the expression tree.
+ // This method should only be called in `canonicalized` or subclass's
`roughlyCanonicalized`.
+ // Subclasses (especially leaf nodes) should override this method to
customize the
+ // canonicalization logic. Some basic canonicalization rules:
+ // - Names and nullability hints for `DataType`s are stripped. See the
override in
+ // `AttributeReference` and `GetStructField`.
+ // - TimeZoneId for [[Cast]] and [[AnsiCast]] are stripped if
`needsTimeZone` is false.
+ // - Rearrange the inputs of certain predicate expressions according to the
`hashCode` of inputs.
+ lazy val roughlyCanonicalized: Expression = {
Review comment:
Yeah .. or `fastCanonicalized`?
--
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]