[SPARK-41404][SQL] Refactor ColumnVectorUtils#toBatch to make ColumnarBatchSuite#testRandomRows test more primitive dataType#38933
Conversation
ColumnarBatchSuite#testRandomRows to test more primitive dataTypeColumnarBatchSuite#testRandomRows to test more primitive dataType
ColumnarBatchSuite#testRandomRows to test more primitive dataTypeColumnarBatchSuite#testRandomRows to test more primitive dataType
| dst.getChild(2).appendLong(c.microseconds); | ||
| } else if (t instanceof DateType) { | ||
| dst.appendInt(DateTimeUtils.fromJavaDate((Date)o)); | ||
| if (o instanceof Date) { |
There was a problem hiding this comment.
@cloud-fan As I mentioned at #38873 (comment)
ColumnVectorUtils#toBatch and related appendValue methods only used by test cases:
-
this pr add more primitive dataType support for
toBatchmethod and add more test inColumnarBatchSuite#testRandomRows, do you think this is valuable?I haven't created Jira. -
ColumnVectorUtils#toBatchonly used by test, should we move it fromColumnVectorUtilsto a test only helper class?
There was a problem hiding this comment.
We should support all data types, but probably not all java types since it's test-only. We can require tests to only use Date or LocalDate.
For 2, I think it's fine to keep it here.
There was a problem hiding this comment.
OK, change to only test Date and Timestamp due they are default
ColumnarBatchSuite#testRandomRows to test more primitive dataTypeColumnarBatchSuite#testRandomRows to test more primitive dataType
ColumnarBatchSuite#testRandomRows to test more primitive dataTypeColumnarBatchSuite#testRandomRows test more dataType
ColumnarBatchSuite#testRandomRows test more dataTypeColumnVectorUtils#toBatch to make ColumnarBatchSuite#testRandomRows test more dataType
ColumnVectorUtils#toBatch to make ColumnarBatchSuite#testRandomRows test more dataTypeColumnVectorUtils#toBatch to make ColumnarBatchSuite#testRandomRows test more primitive dataType
ColumnVectorUtils#toBatch to make ColumnarBatchSuite#testRandomRows test more primitive dataTypeColumnVectorUtils#toBatch to make ColumnarBatchSuite#testRandomRows test more primitive dataType
dongjoon-hyun
left a comment
There was a problem hiding this comment.
+1, LGTM.
Since this patch still touches sql/core/src/main, I removed [TESTS] from the PR title.
Thanks @dongjoon-hyun |
|
Merged to master. |
…mnarBatchSuite#testRandomRows` test more primitive dataType ### What changes were proposed in this pull request? This pr refactor `ColumnVectorUtils#toBatch` to make `ColumnarBatchSuite#testRandomRows` to test more primitive dataType. ### Why are the changes needed? Support `ColumnarBatchSuite#testRandomRows` to test more primitive dataType ### Does this PR introduce _any_ user-facing change? No, just for test ### How was this patch tested? Pass GitHub Actions Closes apache#38933 from LuciferYang/toBatch-bugfix. Lead-authored-by: yangjie01 <yangjie01@baidu.com> Co-authored-by: YangJie <yangjie01@baidu.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
What changes were proposed in this pull request?
This pr refactor
ColumnVectorUtils#toBatchto makeColumnarBatchSuite#testRandomRowsto test more primitive dataType.Why are the changes needed?
Support
ColumnarBatchSuite#testRandomRowsto test more primitive dataTypeDoes this PR introduce any user-facing change?
No, just for test
How was this patch tested?
Pass GitHub Actions