milesgranger commented on code in PR #14495:
URL: https://github.com/apache/arrow/pull/14495#discussion_r1017892108
##########
cpp/src/arrow/compute/kernels/scalar_nested_test.cc:
##########
@@ -141,16 +148,25 @@ TEST(TestScalarNested, StructField) {
&extract0);
CheckScalar("struct_field", {arr}, ArrayFromJSON(int64(), "[10, 11, 12,
null]"),
&extract20);
+
+ CheckScalar("struct_field", {arr}, ArrayFromJSON(int32(), "[1, null, 3,
null]"),
+ &extract0_field_ref_path);
+ CheckScalar("struct_field", {arr}, ArrayFromJSON(int32(), "[1, null, 3,
null]"),
+ &extract0_field_ref_name);
+ CheckScalar("struct_field", {arr}, ArrayFromJSON(int64(), "[10, 11, 12,
null]"),
+ &extract20_field_ref_nest);
+
EXPECT_RAISES_WITH_MESSAGE_THAT(Invalid,
::testing::HasSubstr("out-of-bounds field
reference"),
CallFunction("struct_field", {arr},
&invalid1));
EXPECT_RAISES_WITH_MESSAGE_THAT(Invalid,
- ::testing::HasSubstr("out-of-bounds field
reference"),
+ ::testing::HasSubstr("No match for
FieldRef"),
CallFunction("struct_field", {arr},
&invalid2));
EXPECT_RAISES_WITH_MESSAGE_THAT(Invalid,
::testing::HasSubstr("out-of-bounds field
reference"),
CallFunction("struct_field", {arr},
&invalid3));
- EXPECT_RAISES_WITH_MESSAGE_THAT(TypeError, ::testing::HasSubstr("cannot
subscript"),
+ EXPECT_RAISES_WITH_MESSAGE_THAT(Invalid,
+ ::testing::HasSubstr("No match for
FieldRef"),
Review Comment:
[ARROW-18295](https://issues.apache.org/jira/browse/ARROW-18295)
--
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]