hcrosse commented on code in PR #1449:
URL: https://github.com/apache/arrow-go/pull/1449#discussion_r4462990155


##########
arrow/compute/exprs/exec.go:
##########
@@ -523,13 +524,17 @@ func execFieldRef(ctx context.Context, e 
*expr.FieldReference, input compute.Exe
        }
 
        dt := out.(compute.ArrayLikeDatum).Type()
-       if !arrow.TypeEqual(dt, expectedType) {
+       valueType := dt
+       if dictType, ok := dt.(*arrow.DictionaryType); ok {
+               valueType = dictType.ValueType

Review Comment:
   I narrowed the pass-through to string and binary dictionaries, which covers 
the case from https://github.com/apache/iceberg-go/issues/2425. Other 
dictionary value types return `arrow.ErrInvalid` as before, and a new test runs 
`is_nan` on a `float64` dictionary and expects that error.
   
   The panic itself is older than this PR. On main, 
`compute.CallFunction("is_nan", ...)` with a `float64` dictionary panics in 
`compareFunction.DispatchBest` too. Fixing unary dispatch there would not be 
enough to accept other dictionary types, because decimal dictionaries still 
fail in comparisons and boolean dictionaries fail in `cast_boolean`, so I left 
that dispatch unchanged here.



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