srowen commented on a change in pull request #29366: URL: https://github.com/apache/spark/pull/29366#discussion_r468603216
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/SpecificInternalRow.scala ########## @@ -192,24 +192,41 @@ final class MutableAny extends MutableValue { */ final class SpecificInternalRow(val values: Array[MutableValue]) extends BaseGenericInternalRow { - def this(dataTypes: Seq[DataType]) = - this( - dataTypes.map { - case BooleanType => new MutableBoolean - case ByteType => new MutableByte - case ShortType => new MutableShort - // We use INT for DATE internally - case IntegerType | DateType => new MutableInt - // We use Long for Timestamp internally - case LongType | TimestampType => new MutableLong - case FloatType => new MutableFloat - case DoubleType => new MutableDouble - case _ => new MutableAny - }.toArray) + private[this] def dataTypeToMutableValue(dataType: DataType): MutableValue = dataType match { + case BooleanType => new MutableBoolean Review comment: Seems plausible. While micro-optimizing, I wonder if the ordering of these matches matters? is it faster to put more common types earlier? ---------------------------------------------------------------- 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