lidavidm commented on a change in pull request #11159:
URL: https://github.com/apache/arrow/pull/11159#discussion_r710215610
##########
File path: cpp/src/arrow/compute/kernels/scalar_nested_test.cc
##########
@@ -39,6 +39,46 @@ TEST(TestScalarNested, ListValueLength) {
}
}
+TEST(TestScalarNested, ListElement) {
+ for (auto ty : {list(int16()), fixed_size_list(uint8(), 2)}) {
+ auto input = ArrayFromJSON(ty, "[[8, 5], [74, 92], [7, 4]]");
+ auto out_ty = ty->id() == Type::LIST ? int16() : uint8();
+ auto expected = ArrayFromJSON(out_ty, "[5, 92, 4]");
+ auto index = ScalarFromJSON(int32(), "1");
+ CheckVectorBinary("list_element", input, Datum(index), expected);
Review comment:
Use CheckScalar. As noted below, you'll need to add support for
all-scalar inputs. The advantage is that CheckScalar automatically also tests
chunked array and scalar inputs for you.
--
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]