executor

package
v3.6.3 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2025 License: AGPL-3.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EOF = errors.New("pipeline exhausted") //nolint:revive,staticcheck
)

Functions

This section is empty.

Types

type Array

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

Array represents a column of data, stored as an arrow.Array.

func (*Array) ColumnType

func (a *Array) ColumnType() types.ColumnType

ColumnType implements ColumnVector.

func (*Array) Len

func (a *Array) Len() int64

Len implements ColumnVector.

func (*Array) Release

func (a *Array) Release()

Release implements ColumnVector.

func (*Array) ToArray

func (a *Array) ToArray() arrow.Array

ToArray implements ColumnVector.

func (*Array) Type

func (a *Array) Type() types.DataType

Type implements ColumnVector.

func (*Array) Value

func (a *Array) Value(i int) any

Value implements ColumnVector.

type ArrayStruct

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

ArrayStruct represents multiple columns of data, stored as an array.Struct. It implements the ColumnVector interface while preserving access to individual fields.

func NewArrayStruct

func NewArrayStruct(arr *array.Struct, ct types.ColumnType) *ArrayStruct

NewArrayStruct creates a new ArrayStruct from an array.Struct

func (*ArrayStruct) ColumnType

func (a *ArrayStruct) ColumnType() types.ColumnType

ColumnType implements ColumnVector.

func (*ArrayStruct) Len

func (a *ArrayStruct) Len() int64

Len implements ColumnVector.

func (*ArrayStruct) Release

func (a *ArrayStruct) Release()

Release decreases the reference count by 1 on underlying Arrow array

func (*ArrayStruct) ToArray

func (a *ArrayStruct) ToArray() arrow.Array

ToArray implements ColumnVector. Returns the underlying struct array.

func (*ArrayStruct) Type

func (a *ArrayStruct) Type() types.DataType

Type implements ColumnVector.

func (*ArrayStruct) Value

func (a *ArrayStruct) Value(i int) any

Value implements ColumnVector. Returns a map of field names to values at the specified index.

type BinaryFunction

type BinaryFunction interface {
	Evaluate(lhs, rhs ColumnVector) (ColumnVector, error)
}

TODO(chaudum): Make BinaryFunction typed:

type BinaryFunction[L, R arrow.DataType] interface {
	Evaluate(lhs ColumnVector[L], rhs ColumnVector[R]) (ColumnVector[arrow.BOOL], error)
}

type BinaryFunctionRegistry

type BinaryFunctionRegistry interface {
	GetForSignature(types.BinaryOp, arrow.DataType) (BinaryFunction, error)
	// contains filtered or unexported methods
}

type BufferedPipeline

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

BufferedPipeline is a pipeline implementation that reads from a fixed set of Arrow records. It implements the Pipeline interface and serves as a simple source for testing and data injection.

func NewBufferedPipeline

func NewBufferedPipeline(records ...arrow.Record) *BufferedPipeline

NewBufferedPipeline creates a new BufferedPipeline from a set of Arrow records. The pipeline will return these records in sequence.

func (*BufferedPipeline) Close

func (p *BufferedPipeline) Close()

Close implements Pipeline. It releases all unreturned records.

func (*BufferedPipeline) Read

Read implements Pipeline. It advances to the next record and returns EOF when all records have been read.

type CoalesceVector

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

CoalesceVector represents multiple columns with the same name but different types.ColumnType Vectors are ordered by precedence (highest precedence first).

func (*CoalesceVector) ColumnType

func (m *CoalesceVector) ColumnType() types.ColumnType

ColumnType implements ColumnVector.

func (*CoalesceVector) Len

func (m *CoalesceVector) Len() int64

Len implements ColumnVector.

func (*CoalesceVector) Release

func (m *CoalesceVector) Release()

Release implements ColumnVector.

func (*CoalesceVector) ToArray

func (m *CoalesceVector) ToArray() arrow.Array

ToArray implements ColumnVector.

func (*CoalesceVector) Type

func (m *CoalesceVector) Type() types.DataType

Type implements ColumnVector.

func (*CoalesceVector) Value

func (m *CoalesceVector) Value(i int) any

Value returns the value at the specified index position considering the precedence rules.

type ColumnVector

type ColumnVector interface {
	// ToArray returns the underlying Arrow array representation of the column vector.
	ToArray() arrow.Array
	// Value returns the value at the specified index position in the column vector.
	Value(i int) any
	// Type returns the Loki data type of the column vector.
	Type() types.DataType
	// ColumnType returns the type of column the vector originates from.
	ColumnType() types.ColumnType
	// Len returns the length of the vector
	Len() int64
	// Release decreases the reference count by 1 on underlying Arrow array
	Release()
}

ColumnVector represents columnar values from evaluated expressions.

type Config

type Config struct {
	BatchSize int64
	Bucket    objstore.Bucket

	MergePrefetchCount int
}

type Context

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

Context is the execution context

type GenericPipeline

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

func NewFilterPipeline

func NewFilterPipeline(filter *physical.Filter, input Pipeline, evaluator expressionEvaluator, allocator memory.Allocator) *GenericPipeline

func NewLimitPipeline

func NewLimitPipeline(input Pipeline, skip, fetch uint32) *GenericPipeline

func NewParsePipeline

func NewParsePipeline(parse *physical.ParseNode, input Pipeline, allocator memory.Allocator) *GenericPipeline

func (*GenericPipeline) Close

func (p *GenericPipeline) Close()

Close implements Pipeline.

func (*GenericPipeline) Read

func (p *GenericPipeline) Read(ctx context.Context) (arrow.Record, error)

Read implements Pipeline.

type Merge

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

Merge is a pipeline that takes N inputs and sequentially consumes each one of them. It completely exhausts an input before moving to the next one.

func (*Merge) Close

func (m *Merge) Close()

Close implements Pipeline.

func (*Merge) Read

func (m *Merge) Read(ctx context.Context) (arrow.Record, error)

Read reads the next batch from the pipeline. It returns an error if reading fails or when the pipeline is exhausted.

type Pipeline

type Pipeline interface {
	// Read collects the next value ([arrow.Record]) from the pipeline and returns it to the caller.
	// It returns an error if reading fails or when the pipeline is exhausted. In this case, the function returns EOF.
	Read(context.Context) (arrow.Record, error)
	// Close closes the resources of the pipeline.
	// The implementation must close all the of the pipeline's inputs.
	Close()
}

Pipeline represents a data processing pipeline that can read Arrow records. It provides methods to read data, access the current record, and close resources.

func NewProjectPipeline

func NewProjectPipeline(input Pipeline, proj *physical.Projection, evaluator *expressionEvaluator) (Pipeline, error)

func Run

func Run(ctx context.Context, cfg Config, plan *physical.Plan, logger log.Logger) Pipeline

type Scalar

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

Scalar represents a single value repeated any number of times.

func (*Scalar) ColumnType

func (v *Scalar) ColumnType() types.ColumnType

ColumnType implements ColumnVector.

func (*Scalar) Len

func (v *Scalar) Len() int64

Len implements ColumnVector.

func (*Scalar) Release

func (v *Scalar) Release()

Release implements ColumnVector.

func (*Scalar) ToArray

func (v *Scalar) ToArray() arrow.Array

ToArray implements ColumnVector.

func (*Scalar) Type

func (v *Scalar) Type() types.DataType

Type implements ColumnVector.

func (*Scalar) Value

func (v *Scalar) Value(_ int) any

Value implements ColumnVector.

type UnaryFunc

type UnaryFunc func(ColumnVector, memory.Allocator) (ColumnVector, error)

func (UnaryFunc) Evaluate

func (f UnaryFunc) Evaluate(lhs ColumnVector, allocator memory.Allocator) (ColumnVector, error)

type UnaryFunction

type UnaryFunction interface {
	Evaluate(lhs ColumnVector, allocator memory.Allocator) (ColumnVector, error)
}

type UnaryFunctionRegistry

type UnaryFunctionRegistry interface {
	GetForSignature(types.UnaryOp, arrow.DataType) (UnaryFunction, error)
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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