hcrosse opened a new pull request, #1561:
URL: https://github.com/apache/arrow-go/pull/1561

   ### Rationale for this change
   
   When a bound field reference has the wrong type, `ExecuteScalarExpression` 
returns an error that names the wrong field or none. I bound `col` as `int64` 
over `int32` data at top level and `col.a` the same way inside a struct. Both 
schemas have a leading `int8` column `x`. On v18.8.0 and main, I got:
   
   ```text
   invalid: referenced field %!s(<nil>) was int32, but should have been int64
   invalid: referenced field .field(0) was int32, but should have been int64
   ```
   
   The full references are `.field(1)` and `.field(1).field(0)`. Arrow C++ 
names the whole reference in the same error:
   
   
https://github.com/apache/arrow/blob/976779b2aac587f51b87c3bd2e6ae4c36f75ab6c/cpp/src/arrow/compute/expression.cc#L763-L765
   
   ### What changes are included in this PR?
   
   `execFieldRef` strips the first struct field segment to find the column, and 
the error formatted what was left. It now formats the original `e.Reference`.
   
   ### Are these changes tested?
   
   `TestFieldRefTypeMismatchReleases` gains a `wantMsg` column for its top 
level and nested rows. Both rows fail on main and pass with this change.
   
   With Go 1.26.10, vet and race tests for `arrow/compute/...`, `golangci-lint` 
2.13.2 and the Release Audit Tool passed.
   
   ### Are there any user-facing changes?
   
   Yes. Type mismatch errors now name the full field reference. There is no API 
change.
   


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