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 2021/04/08 16:36:31 UTC
[GitHub] [spark] dbaliafroozeh commented on a change in pull request #32030: [SPARK-34989] Improve the performance of mapChildren and withNewChildren methods
dbaliafroozeh commented on a change in pull request #32030:
URL: https://github.com/apache/spark/pull/32030#discussion_r609889192
##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala
##########
@@ -246,11 +246,50 @@ abstract class TreeNode[BaseType <: TreeNode[BaseType]] extends Product {
arr
}
+ private def childrenTheSame(
+ originalChildren: IndexedSeq[BaseType], newChildren: IndexedSeq[BaseType]): Boolean = {
+ val size = originalChildren.size
+ var i = 0
+ var childrenTheSame = true
+ while (i < size && childrenTheSame) {
Review comment:
And also `break` in Scala doesn't translate to Java break, throws an exception and is expensive.
--
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org