You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/08/13 04:12:13 UTC
[GitHub] [spark] HyukjinKwon commented on a change in pull request #29366: [SPARK-32550][SQL] Make SpecificInternalRow constructors faster by using while loops instead of maps
HyukjinKwon commented on a change in pull request #29366:
URL: https://github.com/apache/spark/pull/29366#discussion_r469685642
##########
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:
I think this is a good point.
----------------------------------------------------------------
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