dictutils

package
v18.0.0-...-f9949aa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2024 License: Apache-2.0, BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectDictionaries

func CollectDictionaries(batch arrow.Record, mapper *Mapper) (out []dictpair, err error)

func ResolveDictionaries

func ResolveDictionaries(memo *Memo, cols []arrow.ArrayData, parentPos FieldPos, mem memory.Allocator) error

func ResolveFieldDict

func ResolveFieldDict(memo *Memo, data arrow.ArrayData, pos FieldPos, mem memory.Allocator) error

Types

type FieldPos

type FieldPos struct {
	// contains filtered or unexported fields
}

func NewFieldPos

func NewFieldPos() FieldPos

func (*FieldPos) Child

func (f *FieldPos) Child(index int32) FieldPos

func (*FieldPos) Path

func (f *FieldPos) Path() []int32

type Kind

type Kind int8
const (
	KindNew Kind = iota
	KindDelta
	KindReplacement
)

type Mapper

type Mapper struct {
	// contains filtered or unexported fields
}

func (*Mapper) AddField

func (d *Mapper) AddField(id int64, fieldPath []int32) error

func (*Mapper) GetFieldID

func (d *Mapper) GetFieldID(fieldPath []int32) (int64, error)

func (*Mapper) ImportField

func (d *Mapper) ImportField(pos FieldPos, field arrow.Field)

func (*Mapper) ImportFields

func (d *Mapper) ImportFields(pos FieldPos, fields []arrow.Field)

func (*Mapper) ImportSchema

func (d *Mapper) ImportSchema(schema *arrow.Schema)

func (*Mapper) InsertPath

func (d *Mapper) InsertPath(pos FieldPos)

func (*Mapper) NumDicts

func (d *Mapper) NumDicts() int

func (*Mapper) NumFields

func (d *Mapper) NumFields() int

type Memo

type Memo struct {
	Mapper Mapper
	// contains filtered or unexported fields
}

func NewMemo

func NewMemo() Memo

func (*Memo) Add

func (memo *Memo) Add(id int64, v arrow.ArrayData)

func (*Memo) AddDelta

func (memo *Memo) AddDelta(id int64, v arrow.ArrayData)

func (*Memo) AddOrReplace

func (memo *Memo) AddOrReplace(id int64, v arrow.ArrayData) bool

AddOrReplace puts the provided dictionary into the memo table. If it already exists, then the new data will replace it. Otherwise it is added to the memo table.

func (*Memo) AddType

func (memo *Memo) AddType(id int64, typ arrow.DataType) error

func (*Memo) Clear

func (memo *Memo) Clear()

func (*Memo) Dict

func (memo *Memo) Dict(id int64, mem memory.Allocator) (arrow.ArrayData, error)

func (Memo) HasDict

func (memo Memo) HasDict(v arrow.ArrayData) bool

func (Memo) HasID

func (memo Memo) HasID(id int64) bool

func (*Memo) Len

func (memo *Memo) Len() int

func (*Memo) Type

func (memo *Memo) Type(id int64) (arrow.DataType, bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL