Source File
nullarray.go
Belonging Package
github.com/polarsignals/frostdb/pqarrow/arrowutils
package arrowutilsimport ()// VirtualNullArray is an arrow.Array that will return that any element is null// via the arrow.Array interface methods. This is useful if callers need to// represent an array of len NULL values without allocating/storing a bitmap.// This should only be used internally. If callers need a physical null array,// call MakeNullArray.type VirtualNullArray struct {dt arrow.DataTypelen int}func ( arrow.DataType, int) VirtualNullArray {return VirtualNullArray{dt: ,len: ,}}// MakeNullArray makes a physical arrow.Array full of NULLs of the given// DataType.func ( memory.Allocator, arrow.DataType, int) arrow.Array {// TODO(asubiotto): This can be improved by using the optimized builders'// AppendNulls. Not sure whether this should be part of the builder package.:= builder.NewBuilder(, )defer .Release().Reserve()for := 0; < ; ++ {.AppendNull()}return .NewArray()}func ( VirtualNullArray) () ([]byte, error) {panic("VirtualNullArray: MarshalJSON not implemented")}func ( VirtualNullArray) () arrow.DataType {return .dt}func ( VirtualNullArray) () int {return .len}func ( VirtualNullArray) () []byte {panic("VirtualNullArray: NullBitmapBytes not implemented")}func ( VirtualNullArray) ( int) bool {return true}func ( VirtualNullArray) ( int) bool {return false}func ( VirtualNullArray) () arrow.ArrayData {panic("VirtualNullArray: Data not implemented")}func ( VirtualNullArray) () int {return .len}func ( VirtualNullArray) () {}func ( VirtualNullArray) () {}func ( VirtualNullArray) () string { return "VirtualNullArray" }func ( VirtualNullArray) ( int) string { return "" }func ( VirtualNullArray) ( int) any { return nil }
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |