cloud-fan commented on a change in pull request #32507:
URL: https://github.com/apache/spark/pull/32507#discussion_r630683577



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/ApplyFunctionExpression.scala
##########
@@ -30,10 +30,11 @@ case class ApplyFunctionExpression(
   override def dataType: DataType = function.resultType()
 
   private lazy val reusedRow = new GenericInternalRow(children.size)
+  private lazy val childrenWithIndex = children.zipWithIndex
 
   /** Returns the result of evaluating this expression on a given input Row */
   override def eval(input: InternalRow): Any = {
-    children.zipWithIndex.foreach {
+    childrenWithIndex.foreach {

Review comment:
       shall we simply use a while loop with a counter? Adding a lazy val as a 
class member variable looks a bit heavy.




-- 
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to