You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/12/06 08:28:52 UTC

[GitHub] [spark] LuciferYang commented on a diff in pull request #38933: [SPARK-41404][SQL][TESTS] Support `ColumnarBatchSuite#testRandomRows` to test more primitive dataType

LuciferYang commented on code in PR #38933:
URL: https://github.com/apache/spark/pull/38933#discussion_r1040616970


##########
sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/ColumnVectorUtils.java:
##########
@@ -165,7 +171,17 @@ private static void appendValue(WritableColumnVector dst, DataType t, Object o)
         dst.getChild(1).appendInt(c.days);
         dst.getChild(2).appendLong(c.microseconds);
       } else if (t instanceof DateType) {
-        dst.appendInt(DateTimeUtils.fromJavaDate((Date)o));
+        if (o instanceof Date) {

Review Comment:
   @cloud-fan As I mentioned at https://github.com/apache/spark/pull/38873#discussion_r1039618680
   
   `ColumnVectorUtils#toBatch` and related `appendValue` methods only used by test cases:
   
   1. this pr add more primitive  dataType support for `toBatch` method and add more test in  `ColumnarBatchSuite#testRandomRows`, do you think this is valuable? ~I haven't created Jira.~
   
   2. `ColumnVectorUtils#toBatch` only used by test, should we move it from `ColumnVectorUtils`  to a test only helper class?
   
   



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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