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