You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/06/02 19:25:49 UTC
[GitHub] [spark] hvanhovell commented on a change in pull request #24766:
[SPARK-27917][SQL] canonical form of CaseWhen object is incorrect
hvanhovell commented on a change in pull request #24766: [SPARK-27917][SQL] canonical form of CaseWhen object is incorrect
URL: https://github.com/apache/spark/pull/24766#discussion_r289654733
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala
##########
@@ -234,6 +234,8 @@ abstract class TreeNode[BaseType <: TreeNode[BaseType]] extends Product {
}
def mapChild(child: Any): Any = child match {
case arg: TreeNode[_] if containsChild(arg) => mapTreeNode(arg)
+ // CaseWhen Case or any tuple type
+ case tuple: (_, _) => (mapChild(tuple._1), mapChild(tuple._2))
Review comment:
Let's make better use of pattern matching here, and deconstruct the tuple there, e.g.: `case (left, right) => (mapChild(left), mapChild(right))`
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org