github.com/segmentio/parquet-go@v0.0.0-20230712180008-5d42db8f0d47/null_purego.go (about) 1 //go:build go1.18 && (purego || !amd64) 2 3 package parquet 4 5 import "github.com/segmentio/parquet-go/sparse" 6 7 func nullIndexBool(bits []uint64, rows sparse.Array) { 8 nullIndex[bool](bits, rows) 9 } 10 11 func nullIndexInt(bits []uint64, rows sparse.Array) { 12 nullIndex[int](bits, rows) 13 } 14 15 func nullIndexInt32(bits []uint64, rows sparse.Array) { 16 nullIndex[int32](bits, rows) 17 } 18 19 func nullIndexInt64(bits []uint64, rows sparse.Array) { 20 nullIndex[int64](bits, rows) 21 } 22 23 func nullIndexUint(bits []uint64, rows sparse.Array) { 24 nullIndex[uint](bits, rows) 25 } 26 27 func nullIndexUint32(bits []uint64, rows sparse.Array) { 28 nullIndex[uint32](bits, rows) 29 } 30 31 func nullIndexUint64(bits []uint64, rows sparse.Array) { 32 nullIndex[uint64](bits, rows) 33 } 34 35 func nullIndexUint128(bits []uint64, rows sparse.Array) { 36 nullIndex[[16]byte](bits, rows) 37 } 38 39 func nullIndexFloat32(bits []uint64, rows sparse.Array) { 40 nullIndex[float32](bits, rows) 41 } 42 43 func nullIndexFloat64(bits []uint64, rows sparse.Array) { 44 nullIndex[float64](bits, rows) 45 } 46 47 func nullIndexString(bits []uint64, rows sparse.Array) { 48 nullIndex[string](bits, rows) 49 } 50 51 func nullIndexSlice(bits []uint64, rows sparse.Array) { 52 for i := 0; i < rows.Len(); i++ { 53 p := *(**struct{})(rows.Index(i)) 54 b := uint64(0) 55 if p != nil { 56 b = 1 57 } 58 bits[uint(i)/64] |= b << (uint(i) % 64) 59 } 60 } 61 62 func nullIndexPointer(bits []uint64, rows sparse.Array) { 63 nullIndex[*struct{}](bits, rows) 64 }