spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [spark] LuciferYang commented on a change in pull request #29529: [SPARK-32690][SQL] Eliminate negative impact from SPARK-32550
Date Mon, 24 Aug 2020 14:23:26 GMT

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



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


Mime
View raw message