github.com/vc42/parquet-go@v0.0.0-20240320194221-1a9adb5f23f5/sparse/gather.go (about) 1 package sparse 2 3 import "unsafe" 4 5 func GatherInt32(dst []int32, src Int32Array) int { 6 return GatherUint32(*(*[]uint32)(unsafe.Pointer(&dst)), src.Uint32Array()) 7 } 8 9 func GatherInt64(dst []int64, src Int64Array) int { 10 return GatherUint64(*(*[]uint64)(unsafe.Pointer(&dst)), src.Uint64Array()) 11 } 12 13 func GatherFloat32(dst []float32, src Float32Array) int { 14 return GatherUint32(*(*[]uint32)(unsafe.Pointer(&dst)), src.Uint32Array()) 15 } 16 17 func GatherFloat64(dst []float64, src Float64Array) int { 18 return GatherUint64(*(*[]uint64)(unsafe.Pointer(&dst)), src.Uint64Array()) 19 } 20 21 func GatherBits(dst []byte, src Uint8Array) int { return gatherBits(dst, src) } 22 23 func GatherUint32(dst []uint32, src Uint32Array) int { return gather32(dst, src) } 24 25 func GatherUint64(dst []uint64, src Uint64Array) int { return gather64(dst, src) } 26 27 func GatherUint128(dst [][16]byte, src Uint128Array) int { return gather128(dst, src) } 28 29 func min(a, b int) int { 30 if a < b { 31 return a 32 } 33 return b 34 }