Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arrow/compute/exec/kernel.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ import (
"context"
"fmt"
"hash/maphash"
"slices"
"strings"

"github.com/apache/arrow-go/v18/arrow"
"github.com/apache/arrow-go/v18/arrow/bitutil"
"github.com/apache/arrow-go/v18/arrow/internal/debug"
"github.com/apache/arrow-go/v18/arrow/memory"
"golang.org/x/exp/slices"
)

var hashSeed = maphash.MakeSeed()
Expand Down
8 changes: 4 additions & 4 deletions arrow/compute/exec/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
package exec

import (
"cmp"
"fmt"
"math"
"slices"
"sync/atomic"
"unsafe"

"github.com/apache/arrow-go/v18/arrow"
"github.com/apache/arrow-go/v18/arrow/array"
"github.com/apache/arrow-go/v18/arrow/bitutil"
"github.com/apache/arrow-go/v18/arrow/memory"
"golang.org/x/exp/constraints"
"golang.org/x/exp/slices"
)

// GetSpanValues returns a properly typed slice by reinterpreting
Expand All @@ -51,14 +51,14 @@ func GetSpanOffsets[T int32 | int64](span *ArraySpan, i int) []T {
return ret[span.Offset:]
}

func Min[T constraints.Ordered](a, b T) T {
func Min[T cmp.Ordered](a, b T) T {
if a < b {
return a
}
return b
}

func Max[T constraints.Ordered](a, b T) T {
func Max[T cmp.Ordered](a, b T) T {
if a > b {
return a
}
Comment on lines 54 to 64
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to get around to removing these entirely and just using the updated built-ins.... but that doesn't have to happen for this PR

Expand Down
6 changes: 3 additions & 3 deletions arrow/compute/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
package compute

import (
"maps"
"slices"
"sync"

"github.com/apache/arrow-go/v18/arrow/internal/debug"
"golang.org/x/exp/maps"
"golang.org/x/exp/slices"
)

type FunctionRegistry interface {
Expand Down Expand Up @@ -138,7 +138,7 @@ func (reg *funcRegistry) GetFunctionNames() (out []string) {
reg.mx.RLock()
defer reg.mx.RUnlock()

out = append(out, maps.Keys(reg.nameToFunction)...)
out = append(out, slices.Collect(maps.Keys(reg.nameToFunction))...)
slices.Sort(out)
return
}
Expand Down
2 changes: 1 addition & 1 deletion arrow/compute/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ package compute_test
import (
"context"
"errors"
"slices"
"testing"

"github.com/apache/arrow-go/v18/arrow"
"github.com/apache/arrow-go/v18/arrow/compute"
"github.com/apache/arrow-go/v18/arrow/compute/exec"
"github.com/stretchr/testify/assert"
"golang.org/x/exp/slices"
)

var registry compute.FunctionRegistry
Expand Down
2 changes: 1 addition & 1 deletion arrow/flight/cookie_middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ package flight

import (
"context"
"maps"
"net/http"
"strings"
"sync"
"time"

"golang.org/x/exp/maps"
"google.golang.org/grpc/metadata"
)

Expand Down
5 changes: 3 additions & 2 deletions internal/utils/math.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,21 @@
package utils

import (
"cmp"
"math"
"math/bits"

"golang.org/x/exp/constraints"
)

func Min[T constraints.Ordered](a, b T) T {
func Min[T cmp.Ordered](a, b T) T {
if a < b {
return a
}
return b
}

func Max[T constraints.Ordered](a, b T) T {
func Max[T cmp.Ordered](a, b T) T {
if a > b {
return a
}
Expand Down
Loading