srowen commented on a change in pull request #29366:
URL: https://github.com/apache/spark/pull/29366#discussion_r470999055
##########
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:
OK. Might be worth reordering to integers, floating point, boolean, then
the rest, but it's no big deal.
----------------------------------------------------------------
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]