LuciferYang commented on a change in pull request #29529:
URL: https://github.com/apache/spark/pull/29529#discussion_r475649740



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/SpecificInternalRow.scala
##########
@@ -208,10 +208,9 @@ final class SpecificInternalRow(val values: 
Array[MutableValue]) extends BaseGen
   def this(dataTypes: Seq[DataType]) = {
     // SPARK-32550: use while loop instead of map
     this(new Array[MutableValue](dataTypes.length))
-    val length = values.length
     var i = 0
-    while (i < length) {
-      values(i) = dataTypeToMutableValue(dataTypes(i))
+    dataTypes.foreach { dt =>
+      values(i) = dataTypeToMutableValue(dt)

Review comment:
       Because `schema.fields` is a `Array` , support random access, so there 
was no change of `def this(schema: StructType) ` constructor.




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to