zeroshade commented on code in PR #1352:
URL: https://github.com/apache/arrow-go/pull/1352#discussion_r4199629629


##########
arrow/compute/selection.go:
##########
@@ -535,37 +534,39 @@ func structFilter(ctx *exec.KernelCtx, batch 
*exec.ExecSpan, out *exec.ExecResul
        return nil
 }
 
+func structFilter(ctx *exec.KernelCtx, batch *exec.ExecSpan, out 
*exec.ExecResult) error {

Review Comment:
   Nit: this wrapper only forwards; register `filterWithTake` directly.



##########
arrow/compute/selection.go:
##########
@@ -535,37 +534,39 @@ func structFilter(ctx *exec.KernelCtx, batch 
*exec.ExecSpan, out *exec.ExecResul
        return nil
 }
 
+func structFilter(ctx *exec.KernelCtx, batch *exec.ExecSpan, out 
*exec.ExecResult) error {
+       return filterWithTake(ctx, batch, out)
+}
+
 // dictionaryFilter is a special case for filtering a dictionary array
 //
 // The shared dictionary is reused as-is and never compacted, so the result 
may retain values
 // that are no longer referenced by any index.
 func dictionaryFilter(ctx *exec.KernelCtx, batch *exec.ExecSpan, out 
*exec.ExecResult) error {
-       // convert the filter (boolean array) to indices to take from the 
dictionary array.
-       indices, err := kernels.GetTakeIndices(exec.GetAllocator(ctx.Ctx),
-               &batch.Values[1].Array, 
ctx.State.(kernels.FilterState).NullSelection)
-       if err != nil {
-               return err
+       filterState := ctx.State.(kernels.FilterState)
+       if filterState.NullSelection == kernels.DropNulls &&

Review Comment:
   This also needs to fall back when the indices have nulls: 
`nullable-indices-random50` is +117% vs main. Suggested condition in the review 
body.



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