query

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const PanicMemoryLimit = "memory limit exceeded"

Variables

This section is empty.

Functions

This section is empty.

Types

type AllocatorOption

type AllocatorOption func(*LimitAllocator)

func WithRegistry

func WithRegistry(reg prometheus.Registerer) AllocatorOption

type Builder

type Builder interface {
	Aggregate(aggExpr []*logicalplan.AggregationFunction, groupExprs []logicalplan.Expr) Builder
	Filter(expr logicalplan.Expr) Builder
	Distinct(expr ...logicalplan.Expr) Builder
	Project(projections ...logicalplan.Expr) Builder
	Limit(expr logicalplan.Expr) Builder
	Execute(ctx context.Context, callback func(ctx context.Context, r arrow.Record) error) error
	Explain(ctx context.Context) (string, error)
}

type FakeTableProvider

type FakeTableProvider struct {
	Tables map[string]logicalplan.TableReader
}

func (*FakeTableProvider) GetTable

func (f *FakeTableProvider) GetTable(name string) (logicalplan.TableReader, error)

type FakeTableReader

type FakeTableReader struct {
	Records       []arrow.Record
	FrostdbSchema *dynparquet.Schema
}

func (*FakeTableReader) Iterator

func (r *FakeTableReader) Iterator(
	ctx context.Context,
	_ uint64,
	_ memory.Allocator,
	callbacks []logicalplan.Callback,
	_ ...logicalplan.Option,
) error

func (*FakeTableReader) Schema

func (r *FakeTableReader) Schema() *dynparquet.Schema

func (*FakeTableReader) SchemaIterator

func (*FakeTableReader) View

func (r *FakeTableReader) View(ctx context.Context, fn func(ctx context.Context, tx uint64) error) error

type LimitAllocator

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

LimitAllocator is a wrapper around a memory.Allocator that panics if the memory usage exceeds the defined limit.

func NewLimitAllocator

func NewLimitAllocator(limit int64, allocator memory.Allocator, options ...AllocatorOption) *LimitAllocator

func (*LimitAllocator) Allocate

func (a *LimitAllocator) Allocate(size int) []byte

func (*LimitAllocator) Allocated

func (a *LimitAllocator) Allocated() int

func (*LimitAllocator) Free

func (a *LimitAllocator) Free(b []byte)

func (*LimitAllocator) Reallocate

func (a *LimitAllocator) Reallocate(size int, b []byte) []byte

type LocalEngine

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

func NewEngine

func NewEngine(
	pool memory.Allocator,
	tableProvider logicalplan.TableProvider,
	options ...Option,
) *LocalEngine

func (*LocalEngine) ScanSchema

func (e *LocalEngine) ScanSchema(name string) Builder

func (*LocalEngine) ScanTable

func (e *LocalEngine) ScanTable(name string) Builder

type LocalQueryBuilder

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

func (LocalQueryBuilder) Aggregate

func (b LocalQueryBuilder) Aggregate(
	aggExpr []*logicalplan.AggregationFunction,
	groupExprs []logicalplan.Expr,
) Builder

func (LocalQueryBuilder) Distinct

func (b LocalQueryBuilder) Distinct(
	expr ...logicalplan.Expr,
) Builder

func (LocalQueryBuilder) Execute

func (b LocalQueryBuilder) Execute(ctx context.Context, callback func(ctx context.Context, r arrow.Record) error) error

func (LocalQueryBuilder) Explain

func (b LocalQueryBuilder) Explain(ctx context.Context) (string, error)

func (LocalQueryBuilder) Filter

func (b LocalQueryBuilder) Filter(
	expr logicalplan.Expr,
) Builder

func (LocalQueryBuilder) Limit

func (b LocalQueryBuilder) Limit(
	expr logicalplan.Expr,
) Builder

func (LocalQueryBuilder) Project

func (b LocalQueryBuilder) Project(
	projections ...logicalplan.Expr,
) Builder

type Option

type Option func(*LocalEngine)

func WithPhysicalplanOptions

func WithPhysicalplanOptions(opts ...physicalplan.Option) Option

func WithTracer

func WithTracer(tracer trace.Tracer) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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