Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/23124#discussion_r235849697
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/InternalRow.scala ---
    @@ -125,22 +125,36 @@ object InternalRow {
        * actually takes a `SpecializedGetters` input because it can be 
generalized to other classes
        * that implements `SpecializedGetters` (e.g., `ArrayData`) too.
        */
    -  def getAccessor(dataType: DataType): (SpecializedGetters, Int) => Any = 
dataType match {
    -    case BooleanType => (input, ordinal) => input.getBoolean(ordinal)
    -    case ByteType => (input, ordinal) => input.getByte(ordinal)
    -    case ShortType => (input, ordinal) => input.getShort(ordinal)
    -    case IntegerType | DateType => (input, ordinal) => 
input.getInt(ordinal)
    -    case LongType | TimestampType => (input, ordinal) => 
input.getLong(ordinal)
    -    case FloatType => (input, ordinal) => input.getFloat(ordinal)
    -    case DoubleType => (input, ordinal) => input.getDouble(ordinal)
    -    case StringType => (input, ordinal) => input.getUTF8String(ordinal)
    -    case BinaryType => (input, ordinal) => input.getBinary(ordinal)
    -    case CalendarIntervalType => (input, ordinal) => 
input.getInterval(ordinal)
    -    case t: DecimalType => (input, ordinal) => input.getDecimal(ordinal, 
t.precision, t.scale)
    -    case t: StructType => (input, ordinal) => input.getStruct(ordinal, 
t.size)
    -    case _: ArrayType => (input, ordinal) => input.getArray(ordinal)
    -    case _: MapType => (input, ordinal) => input.getMap(ordinal)
    -    case u: UserDefinedType[_] => getAccessor(u.sqlType)
    -    case _ => (input, ordinal) => input.get(ordinal, dataType)
    +  def getAccessor(dt: DataType, nullable: Boolean = true): 
(SpecializedGetters, Int) => Any = {
    --- End diff --
    
    I can move it to a new PR if others think it's necessary. It's a little 
dangerous to ask the caller side to take care of null values.


---

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

Reply via email to