milesgranger commented on code in PR #14495:
URL: https://github.com/apache/arrow/pull/14495#discussion_r1016452877


##########
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"),

Review Comment:
   Ya sorry, this was just a sub-string to the whole error, which is:
   > No match for FieldRef.FieldPath(2 4) in struct<a: int32, b: string, c: 
struct<d: int64, e: double>>
   
   Is this okay, and/or should I include the whole/more of it into the 
`HasSubstr`check?



-- 
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]

Reply via email to