This is an automated email from the ASF dual-hosted git repository.

zeroshade pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-go.git


The following commit(s) were added to refs/heads/main by this push:
     new cc612e36 fix(compute): report FuncMeta for meta functions (#1155)
cc612e36 is described below

commit cc612e3649cb7c06c6c92f17d37b832d09add10e
Author: Minh Vu <[email protected]>
AuthorDate: Tue Aug 25 23:28:30 2026 +0200

    fix(compute): report FuncMeta for meta functions (#1155)
    
    ## What
    
    Set the function kind when constructing a MetaFunction. NewMetaFunction
    now reports FuncMeta instead of the zero-value scalar kind.
    
    ## Test
    
    - go test ./arrow/compute -count=1
---
 arrow/compute/functions.go      |  1 +
 arrow/compute/functions_test.go | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/arrow/compute/functions.go b/arrow/compute/functions.go
index 84f9bbcb..aad36dac 100644
--- a/arrow/compute/functions.go
+++ b/arrow/compute/functions.go
@@ -398,6 +398,7 @@ func NewMetaFunction(name string, arity Arity, doc 
FunctionDoc, impl MetaFunctio
        return &MetaFunction{
                baseFunction: baseFunction{
                        name:  name,
+                       kind:  FuncMeta,
                        arity: arity,
                        doc:   doc,
                },
diff --git a/arrow/compute/functions_test.go b/arrow/compute/functions_test.go
index 72f4877b..19d8d85b 100644
--- a/arrow/compute/functions_test.go
+++ b/arrow/compute/functions_test.go
@@ -19,6 +19,7 @@
 package compute_test
 
 import (
+       "context"
        "testing"
 
        "github.com/apache/arrow-go/v18/arrow"
@@ -49,6 +50,25 @@ func TestArityBasics(t *testing.T) {
        assert.True(t, varargs.IsVarArgs)
 }
 
+func TestNewMetaFunctionKind(t *testing.T) {
+       fn := compute.NewMetaFunction("test_meta", compute.Nullary(), 
compute.EmptyFuncDoc,
+               func(context.Context, compute.FunctionOptions, 
...compute.Datum) (compute.Datum, error) {
+                       return nil, nil
+               })
+
+       assert.Equal(t, compute.FuncMeta, fn.Kind())
+}
+
+func TestRegisteredMetaFunctionKinds(t *testing.T) {
+       for _, name := range []string{"cast", "filter", "take", "sort", 
"sort_indices"} {
+               t.Run(name, func(t *testing.T) {
+                       fn, ok := 
compute.GetFunctionRegistry().GetFunction(name)
+                       require.True(t, ok)
+                       assert.Equal(t, compute.FuncMeta, fn.Kind())
+               })
+       }
+}
+
 func CheckDispatchBest(t *testing.T, funcName string, originalTypes, expected 
[]arrow.DataType) {
        fn, exists := compute.GetFunctionRegistry().GetFunction(funcName)
        require.True(t, exists)

Reply via email to