groupby

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2021 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultLimit = 1000000

Functions

This section is empty.

Types

type Aggregator

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

Aggregator performs the core aggregation computation for a list of reducer generators. It handles both regular and time-binned ("every") group-by operations. Records are generated in a deterministic but undefined total order.

func NewAggregator

func NewAggregator(ctx context.Context, zctx *zed.Context, keyRefs, keyExprs, aggRefs []expr.Evaluator, aggs []*expr.Aggregator, builder *zed.ColumnBuilder, limit int, inputDir order.Direction, partialsIn, partialsOut bool) (*Aggregator, error)

func (*Aggregator) Consume

func (a *Aggregator) Consume(r *zed.Value) error

Consume adds a record to the aggregation.

func (*Aggregator) Results

func (a *Aggregator) Results(eof bool) (zbuf.Batch, error)

Results returns a batch of aggregation result records. Upon eof, this should be called repeatedly until a nil batch is returned. If the input is sorted in the primary key, Results can be called before eof, and keys that are completed will returned.

type Proc

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

Proc computes aggregations using an Aggregator.

func New

func New(pctx *proc.Context, parent proc.Interface, keys []expr.Assignment, aggNames field.List, aggs []*expr.Aggregator, limit int, inputSortDir order.Direction, partialsIn, partialsOut bool) (*Proc, error)

func (*Proc) Done

func (p *Proc) Done()

func (*Proc) Pull

func (p *Proc) Pull() (zbuf.Batch, error)

type Row

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

Jump to

Keyboard shortcuts

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