zeroshade commented on code in PR #1249:
URL: https://github.com/apache/arrow-go/pull/1249#discussion_r3884245004
##########
arrow/array/compare.go:
##########
@@ -353,6 +353,10 @@ func Equal(left, right arrow.Array) bool {
// SliceEqual reports whether slices left[lbeg:lend] and right[rbeg:rend] are
equal.
func SliceEqual(left arrow.Array, lbeg, lend int64, right arrow.Array, rbeg,
rend int64) bool {
+ if lbeg == 0 && lend == int64(left.Len()) && rbeg == 0 && rend ==
int64(right.Len()) {
Review Comment:
The full-range fast path calls `Equal` on the original interface values.
`Equal` only handles Arrow-Go’s concrete array types or `ExtensionArray`, so
another valid `arrow.Array` implementation now panics. Wrapping an
`*array.Int64` in `struct{ arrow.Array }` and calling full-range `SliceEqual`
previously returned `true`; this head panics with `arrow/array: unknown array
type`. Please retain the slice-normalization path for unsupported
implementations or make `Equal` safely normalize generic arrays, and add the
wrapper regression test.
--
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]