ZhangHuiGui commented on code in PR #41925:
URL: https://github.com/apache/arrow/pull/41925#discussion_r1623739427
##########
cpp/src/arrow/compute/expression_test.cc:
##########
@@ -909,6 +909,39 @@ TEST(Expression, ExecuteCallWithNoArguments) {
EXPECT_EQ(actual.length(), kCount);
}
+TEST(Expression, ExecuteChunkedArray) {
Review Comment:
I think the fix is fine.
BTW, we should add one more test that the output data is also
`ChunkedArray`, like
```c
const int32_t length = 9;
auto chunk_arr1 =
ChunkedArrayFromJSON(int32(), {"[3, 1, 0, 3, null]", "[1, 2, 6,
null]"});
auto chunk_arr2 =
ChunkedArrayFromJSON(int32(), {"[9, 0, 3, 1, null]", "[1, 8, 3,
null]"});
auto expr = call("min_element_wise", {field_ref("a"), field_ref("b")});
auto input_schema = schema({field("a", int32()), field("b", int32())});
ASSERT_OK_AND_ASSIGN(expr, expr.Bind(*input_schema));
ExecBatch batch{{chunk_arr1, chunk_arr2}, length};
ASSERT_OK_AND_ASSIGN(auto res, ExecuteScalarExpression(expr, batch));
AssertDatumsEqual(
res, ChunkedArrayFromJSON(int32(), {"[3, 0, 0, 1, null]", "[1, 2, 3,
null]"}));
```
Because the comment
https://github.com/apache/arrow/issues/41923#issuecomment-2143796671 mentioned
that function kernel with `NullHandling::type::COMPUTED_NO_PREALLOCATE` will
return chunked-array when the input is chunked-array.
And also, we should add chunked-array support to `MakeExecBatch`, because
the expression system can handle chunked-array normally, so this can be opened
as a separate issue include simplify these tests by `ExpectExecute`.
--
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]