cloud-fan commented on code in PR #38873:
URL: https://github.com/apache/spark/pull/38873#discussion_r1037874336


##########
sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/ColumnVectorUtils.java:
##########
@@ -125,32 +122,37 @@ public static Map<Integer, Integer> 
toJavaIntMap(ColumnarMap map) {
   }
 
   private static void appendValue(WritableColumnVector dst, DataType t, Object 
o) {
+    PhysicalDataType pdt = t.physicalDataType();
     if (o == null) {
-      if (t instanceof CalendarIntervalType) {
+      if (pdt instanceof PhysicalCalendarIntervalType) {
         dst.appendStruct(true);
       } else {
         dst.appendNull();
       }
     } else {
-      if (t == DataTypes.BooleanType) {
+      if (pdt instanceof PhysicalBooleanType) {
         dst.appendBoolean((Boolean) o);
-      } else if (t == DataTypes.ByteType) {
+      } else if (pdt instanceof PhysicalByteType) {
         dst.appendByte((Byte) o);
-      } else if (t == DataTypes.ShortType) {
+      } else if (pdt instanceof PhysicalShortType) {
         dst.appendShort((Short) o);
-      } else if (t == DataTypes.IntegerType) {
-        dst.appendInt((Integer) o);
-      } else if (t == DataTypes.LongType) {
+      } else if (pdt instanceof PhysicalIntegerType) {
+        if (o instanceof Date) {
+          dst.appendInt(DateTimeUtils.fromJavaDate((Date) o));

Review Comment:
   This is a bit weird. Why the caller side passes `Date` for date type but 
`Long` for timestamp type?



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to