node

package
v0.69.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAnd

func NewAnd(left, right Node) *nodeAnd

func NewNAnd

func NewNAnd(negative, regular Node) *nodeNAnd

func NewNot

func NewNot(child Node, minID, maxID LID) *nodeNot

func NewOr

func NewOr(left, right Node) *nodeOr

func NewRange

func NewRange(minVal, maxVal LID) *nodeRange

func TreeFold

func TreeFold[V any](op func(V, V) V, def V, values []V) V

Types

type LID added in v0.69.0

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

LID is an encoded representation of LID and reverse flag made specifically for fast compare operations.

For reverse order LID is inverted as follows: "MaxUint32 - LID" formula using XOR mask. Terminal LID value is 0 instead of MaxUint32 in reverse order, but 0 is XORed to MaxUint32. Which means, null value will always have lid field set to 0xFFFFFFFF (math.MaxUint32) regardless of reverse (order) flag.

func Max added in v0.69.0

func Max(left, right LID) LID

func Min added in v0.69.0

func Min(left, right LID) LID

func NewAscLID added in v0.69.0

func NewAscLID(lid uint32) LID

NewAscLID returns LIDs for asc sort order

func NewDescLID added in v0.69.0

func NewDescLID(lid uint32) LID

NewDescLID returns LIDs for desc sort order

func NewLID added in v0.69.0

func NewLID(lid uint32, asc bool) LID

func NullLID added in v0.69.0

func NullLID() LID

func (LID) Eq added in v0.69.0

func (c LID) Eq(other LID) bool

func (LID) Inc added in v0.69.0

func (c LID) Inc() LID

func (LID) IsNull added in v0.69.0

func (c LID) IsNull() bool

func (LID) Less added in v0.69.0

func (c LID) Less(other LID) bool

Less compares two values. It also does an implicit null check, since we store math.MaxUint32 for null values. Which means if we call x.Less(y), then we know for sure that x is not null. Therefore, this Less call can work as both "null check + less" combo.

func (LID) LessOrEq added in v0.69.0

func (c LID) LessOrEq(other LID) bool

func (LID) String added in v0.69.0

func (c LID) String() string

func (LID) Unpack added in v0.69.0

func (c LID) Unpack() uint32

type Node

type Node interface {
	fmt.Stringer // for testing
	Next() LID
	// NextGeq returns next greater or equal (GEQ) lid
	NextGeq(nextID LID) LID
}

func BuildORTree

func BuildORTree(nodes []Node) Node

func MakeStaticNodes

func MakeStaticNodes(data [][]uint32) []Node

MakeStaticNodes is currently used only for tests

func NewStatic

func NewStatic(data []uint32, reverse bool) Node

type Sourced

type Sourced interface {
	fmt.Stringer // for testing
	// aggregation need source
	NextSourced() (id LID, source uint32)
	NextSourcedGeq(nextLID LID) (id LID, source uint32)
}

func BuildORTreeAgg

func BuildORTreeAgg(nodes []Node) Sourced

func NewNodeOrAgg

func NewNodeOrAgg(left, right Sourced) Sourced

func NewSourcedNodeWrapper

func NewSourcedNodeWrapper(d Node, source int) Sourced

func WrapWithSource

func WrapWithSource(nodes []Node) []Sourced

Jump to

Keyboard shortcuts

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