Github user davies commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5984#discussion_r32373435
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/UnsafeRowConverter.scala
 ---
    @@ -258,3 +264,44 @@ private class StringUnsafeColumnWriter private() 
extends UnsafeColumnWriter {
         8 + ByteArrayMethods.roundNumberOfBytesToNearestWord(numBytes)
       }
     }
    +
    +private class DateUnsafeColumnWriter private() extends UnsafeColumnWriter {
    +  def getSize(source: InternalRow, column: Int): Int = {
    +    0
    +  }
    +
    +  override def write(
    +      source: InternalRow,
    +      target: UnsafeRow,
    +      column: Int,
    +      appendCursor: Int): Int = {
    +    target.setDate(column, source.getDate(column))
    +    0
    +  }
    +}
    +
    +private class TimestampUnsafeColumnWriter private() extends 
UnsafeColumnWriter {
    +  def getSize(source: InternalRow, column: Int): Int = {
    +    // Although Timestamp is fixed length, it needs 12-byte that is more 
than 8-byte word per field.
    +    // So we need to store it at the variable-length section.
    +    16
    --- End diff --
    
    Use use Long for TimestampType in catalyst now (with precision of 100ns) 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to