dongjoon-hyun commented on a change in pull request #32527:
URL: https://github.com/apache/spark/pull/32527#discussion_r631540103



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala
##########
@@ -127,13 +128,18 @@ trait InvokeLike extends Expression with NonSQLExpression 
{
       arguments: Seq[Expression],
       input: InternalRow,
       dataType: DataType): Any = {
-    val args = arguments.map(e => e.eval(input).asInstanceOf[Object])
-    if (needNullCheck && args.exists(_ == null)) {
+    var i = 0
+    val len = arguments.length
+    while (i < len) {
+      evaluatedArgs(i) = arguments(i).eval(input).asInstanceOf[Object]

Review comment:
       I guess it's aims to reuse `Array[Object]` itself and only changes the 
values of array.

##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala
##########
@@ -127,13 +128,18 @@ trait InvokeLike extends Expression with NonSQLExpression 
{
       arguments: Seq[Expression],
       input: InternalRow,
       dataType: DataType): Any = {
-    val args = arguments.map(e => e.eval(input).asInstanceOf[Object])
-    if (needNullCheck && args.exists(_ == null)) {
+    var i = 0
+    val len = arguments.length
+    while (i < len) {
+      evaluatedArgs(i) = arguments(i).eval(input).asInstanceOf[Object]

Review comment:
       I guess it aims to reuse `Array[Object]` itself and only changes the 
values of array.




-- 
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