maropu commented on a change in pull request #26699: [SPARK-30066][SQL] 
Columnar execution support for interval types
URL: https://github.com/apache/spark/pull/26699#discussion_r355241947
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/GenerateColumnAccessor.scala
 ##########
 @@ -109,6 +115,14 @@ object GenerateColumnAccessor extends 
CodeGenerator[Seq[DataType], ColumnarItera
               rowWriter.write($index, (Decimal) null, $p, $s);
             }
            """
+        case CalendarIntervalType =>
+          // For CalendarInterval, it should have 16 bytes to store 
months(Int), days(Int),
+          // microseconds(Long) for future update even it's null now.
+          s"""
+            if (mutableRow.isNullAt($index)) {
+              rowWriter.write($index, (CalendarInterval) null);
+            }
+           """
 
 Review comment:
   Is this patch work related to this discussion? 
https://github.com/apache/spark/pull/26680#discussion_r351153420
   If we can remove this patch, the gen'd code looks nicer to me. cc: 
@cloud-fan 

----------------------------------------------------------------
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]


With regards,
Apache Git Services

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

Reply via email to