Skip to content

Commit 28b81ec

Browse files
authored
ARROW-17500: [Go] Kernel and KernelContext interfaces (#13946)
This implements the interface for Kernels along with a `KernelSignature` struct and the type matching for `InputType` and `OutputType` via a `TypeMatcher` interface. Along with tests for all of the above. Authored-by: Matt Topol <[email protected]> Signed-off-by: Matt Topol <[email protected]>
1 parent 712e06b commit 28b81ec

5 files changed

Lines changed: 1104 additions & 3 deletions

File tree

‎go/arrow/compute/expression.go‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929

3030
"github.com/apache/arrow/go/v10/arrow"
3131
"github.com/apache/arrow/go/v10/arrow/array"
32+
"github.com/apache/arrow/go/v10/arrow/compute/internal"
3233
"github.com/apache/arrow/go/v10/arrow/internal/debug"
3334
"github.com/apache/arrow/go/v10/arrow/ipc"
3435
"github.com/apache/arrow/go/v10/arrow/memory"
@@ -375,7 +376,7 @@ func (c *Call) Hash() uint64 {
375376
h.WriteString(c.funcName)
376377
c.cachedHash = h.Sum64()
377378
for _, arg := range c.args {
378-
c.cachedHash = hashCombine(c.cachedHash, arg.Hash())
379+
c.cachedHash = internal.HashCombine(c.cachedHash, arg.Hash())
379380
}
380381
return c.cachedHash
381382
}
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,15 @@
1414
// See the License for the specific language governing permissions and
1515
// limitations under the License.
1616

17-
package compute
17+
package internal
18+
19+
import "hash/maphash"
20+
21+
var hashSeed = maphash.MakeSeed()
1822

1923
// ADAPTED FROM HASH UTILITIES FOR BOOST
2024

21-
func hashCombine(seed, value uint64) uint64 {
25+
func HashCombine(seed, value uint64) uint64 {
2226
seed ^= value + 0x9e3779b9 + (seed << 6) + (seed >> 2)
2327
return seed
2428
}

0 commit comments

Comments
 (0)