aggregation

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(data []byte) (builder.Aggregator, error)

Types

type Base

type Base struct {
	Typ  builder.ComponentType `json:"type,omitempty"`
	Name string                `json:"name,omitempty"`
}

func (*Base) SetName

func (b *Base) SetName(name string) *Base

func (*Base) SetType

func (b *Base) SetType(typ builder.ComponentType) *Base

func (*Base) Type

func (b *Base) Type() builder.ComponentType

type Cardinality

type Cardinality struct {
	Base
	Fields []string `json:"fields,omitempty"`
	ByRow  *bool    `json:"byRow,omitempty"`
	Round  *bool    `json:"round,omitempty"`
}

func NewCardinality

func NewCardinality() *Cardinality

func (*Cardinality) SetByRow

func (c *Cardinality) SetByRow(byRow bool) *Cardinality

func (*Cardinality) SetFields

func (c *Cardinality) SetFields(fields []string) *Cardinality

func (*Cardinality) SetName

func (c *Cardinality) SetName(name string) *Cardinality

func (*Cardinality) SetRound

func (c *Cardinality) SetRound(round bool) *Cardinality

type Count

type Count struct {
	Base
}

func NewCount

func NewCount() *Count

func (*Count) SetName

func (c *Count) SetName(name string) *Count

type DoubleAny

type DoubleAny struct {
	Base
	FieldName string `json:"fieldName,omitempty"`
}

func NewDoubleAny

func NewDoubleAny() *DoubleAny

func (*DoubleAny) SetFieldName

func (d *DoubleAny) SetFieldName(fieldName string) *DoubleAny

func (*DoubleAny) SetName

func (d *DoubleAny) SetName(name string) *DoubleAny

type DoubleFirst

type DoubleFirst struct {
	Base
	FieldName string `json:"fieldName,omitempty"`
}

func NewDoubleFirst

func NewDoubleFirst() *DoubleFirst

func (*DoubleFirst) SetFieldName

func (d *DoubleFirst) SetFieldName(fieldName string) *DoubleFirst

func (*DoubleFirst) SetName

func (d *DoubleFirst) SetName(name string) *DoubleFirst

type DoubleLast

type DoubleLast struct {
	Base
	FieldName string `json:"fieldName,omitempty"`
}

func NewDoubleLast

func NewDoubleLast() *DoubleLast

func (*DoubleLast) SetFieldName

func (d *DoubleLast) SetFieldName(fieldName string) *DoubleLast

func (*DoubleLast) SetName

func (d *DoubleLast) SetName(name string) *DoubleLast

type DoubleMax

type DoubleMax struct {
	Base
	FieldName  string `json:"fieldName,omitempty"`
	Expression string `json:"expression,omitempty"`
}

func NewDoubleMax

func NewDoubleMax() *DoubleMax

func (*DoubleMax) SetExpression

func (d *DoubleMax) SetExpression(expression string) *DoubleMax

func (*DoubleMax) SetFieldName

func (d *DoubleMax) SetFieldName(fieldName string) *DoubleMax

func (*DoubleMax) SetName

func (d *DoubleMax) SetName(name string) *DoubleMax

type DoubleMean

type DoubleMean struct {
	Base
	FieldName string `json:"fieldName,omitempty"`
}

func NewDoubleMean

func NewDoubleMean() *DoubleMean

func (*DoubleMean) SetFieldName

func (d *DoubleMean) SetFieldName(fieldName string) *DoubleMean

func (*DoubleMean) SetName

func (d *DoubleMean) SetName(name string) *DoubleMean

type DoubleMin

type DoubleMin struct {
	Base
	FieldName  string `json:"fieldName,omitempty"`
	Expression string `json:"expression,omitempty"`
}

func NewDoubleMin

func NewDoubleMin() *DoubleMin

func (*DoubleMin) SetExpression

func (d *DoubleMin) SetExpression(expression string) *DoubleMin

func (*DoubleMin) SetFieldName

func (d *DoubleMin) SetFieldName(fieldName string) *DoubleMin

func (*DoubleMin) SetName

func (d *DoubleMin) SetName(name string) *DoubleMin

type DoubleSum

type DoubleSum struct {
	Base
	FieldName  string `json:"fieldName,omitempty"`
	Expression string `json:"expression,omitempty"`
}

func NewDoubleSum

func NewDoubleSum() *DoubleSum

func (*DoubleSum) SetExpression

func (d *DoubleSum) SetExpression(expression string) *DoubleSum

func (*DoubleSum) SetFieldName

func (d *DoubleSum) SetFieldName(fieldName string) *DoubleSum

func (*DoubleSum) SetName

func (d *DoubleSum) SetName(name string) *DoubleSum

type Filtered

type Filtered struct {
	Base
	Aggregator builder.Aggregator `json:"aggregator,omitempty"`
	Filter     builder.Filter     `json:"filter,omitempty"`
}

func NewFiltered

func NewFiltered() *Filtered

func (*Filtered) SetAggregator

func (f *Filtered) SetAggregator(aggregator builder.Aggregator) *Filtered

func (*Filtered) SetFilter

func (f *Filtered) SetFilter(filter builder.Filter) *Filtered

func (*Filtered) SetName

func (f *Filtered) SetName(name string) *Filtered

func (*Filtered) UnmarshalJSON

func (f *Filtered) UnmarshalJSON(data []byte) error

type FloatAny

type FloatAny struct {
	Base
	FieldName string `json:"fieldName,omitempty"`
}

func NewFloatAny

func NewFloatAny() *FloatAny

func (*FloatAny) SetFieldName

func (f *FloatAny) SetFieldName(fieldName string) *FloatAny

func (*FloatAny) SetName

func (f *FloatAny) SetName(name string) *FloatAny

type FloatFirst

type FloatFirst struct {
	Base
	FieldName string `json:"fieldName,omitempty"`
}

func NewFloatFirst

func NewFloatFirst() *FloatFirst

func (*FloatFirst) SetFieldName

func (f *FloatFirst) SetFieldName(fieldName string) *FloatFirst

func (*FloatFirst) SetName

func (f *FloatFirst) SetName(name string) *FloatFirst

type FloatLast

type FloatLast struct {
	Base
	FieldName string `json:"fieldName,omitempty"`
}

func NewFloatLast

func NewFloatLast() *FloatLast

func (*FloatLast) SetFieldName

func (f *FloatLast) SetFieldName(fieldName string) *FloatLast

func (*FloatLast) SetName

func (f *FloatLast) SetName(name string) *FloatLast

type FloatMax

type FloatMax struct {
	Base
	FieldName  string `json:"fieldName,omitempty"`
	Expression string `json:"expression,omitempty"`
}

func NewFloatMax

func NewFloatMax() *FloatMax

func (*FloatMax) SetExpression

func (f *FloatMax) SetExpression(expression string) *FloatMax

func (*FloatMax) SetFieldName

func (f *FloatMax) SetFieldName(fieldName string) *FloatMax

func (*FloatMax) SetName

func (f *FloatMax) SetName(name string) *FloatMax

type FloatMin

type FloatMin struct {
	Base
	FieldName  string `json:"fieldName,omitempty"`
	Expression string `json:"expression,omitempty"`
}

func NewFloatMin

func NewFloatMin() *FloatMin

func (*FloatMin) SetExpression

func (f *FloatMin) SetExpression(expression string) *FloatMin

func (*FloatMin) SetFieldName

func (f *FloatMin) SetFieldName(fieldName string) *FloatMin

func (*FloatMin) SetName

func (f *FloatMin) SetName(name string) *FloatMin

type FloatSum

type FloatSum struct {
	Base
	FieldName  string `json:"fieldName,omitempty"`
	Expression string `json:"expression,omitempty"`
}

func NewFloatSum

func NewFloatSum() *FloatSum

func (*FloatSum) SetExpression

func (f *FloatSum) SetExpression(expression string) *FloatSum

func (*FloatSum) SetFieldName

func (f *FloatSum) SetFieldName(fieldName string) *FloatSum

func (*FloatSum) SetName

func (f *FloatSum) SetName(name string) *FloatSum

type HLLSketch

type HLLSketch struct {
	Base
	FieldName  string `json:"fieldName,omitempty"`
	LgK        int64  `json:"lgK,omitempty"`
	TgtHLLType string `json:"tgtHllType,omitempty"`
	Round      *bool  `json:"round,omitempty"`
}

HLLSketch holds the HLL sketch struct based on Aggregator section in https://druid.apache.org/docs/latest/development/extensions-core/datasketches-hll.html

func NewHLLSketchBuild

func NewHLLSketchBuild() *HLLSketch

NewHLLSketchBuild create a new instance of HLLSketch with type HLLSketchBuild

func NewHLLSketchMerge

func NewHLLSketchMerge() *HLLSketch

NewHLLSketchMerge create a new instance of HLLSketch with type HLLSketchMerge

func (*HLLSketch) SetFieldName

func (t *HLLSketch) SetFieldName(fieldName string) *HLLSketch

SetFieldName set fieldName

func (*HLLSketch) SetLgK

func (t *HLLSketch) SetLgK(lgk int64) *HLLSketch

SetLgK set lgK. The value needs to be in the [4, 21] range

func (*HLLSketch) SetName

func (t *HLLSketch) SetName(name string) *HLLSketch

SetName set name

func (*HLLSketch) SetRound

func (t *HLLSketch) SetRound(round bool) *HLLSketch

SetRound set round.

func (*HLLSketch) SetTgtHLLType

func (t *HLLSketch) SetTgtHLLType(tgtHLLType string) *HLLSketch

SetTgtHllType set tgtHllType

type Histogram

type Histogram struct {
	Base
	FieldName string    `json:"fieldName,omitempty"`
	Breaks    []float64 `json:"breaks,omitempty"`
}

func NewHistogram

func NewHistogram() *Histogram

func (*Histogram) SetBreaks

func (h *Histogram) SetBreaks(breaks []float64) *Histogram

func (*Histogram) SetFieldName

func (h *Histogram) SetFieldName(fieldName string) *Histogram

func (*Histogram) SetName

func (h *Histogram) SetName(name string) *Histogram

type HyperUnique

type HyperUnique struct {
	Base
	FieldName          string `json:"fieldName,omitempty"`
	IsInputHyperUnique *bool  `json:"isInputHyperUnique,omitempty"`
	Round              *bool  `json:"round,omitempty"`
}

func NewHyperUnique

func NewHyperUnique() *HyperUnique

func (*HyperUnique) SetFieldName

func (h *HyperUnique) SetFieldName(fieldName string) *HyperUnique

func (*HyperUnique) SetIsInputHyperUnique

func (h *HyperUnique) SetIsInputHyperUnique(isInputHyperUnique bool) *HyperUnique

func (*HyperUnique) SetName

func (h *HyperUnique) SetName(name string) *HyperUnique

func (*HyperUnique) SetRound

func (h *HyperUnique) SetRound(round bool) *HyperUnique

type Javascript

type Javascript struct {
	Base
	FieldNames  []string `json:"fieldNames,omitempty"`
	FnAggregate string   `json:"fnAggregate,omitempty"`
	FnReset     string   `json:"fnReset,omitempty"`
	FnCombine   string   `json:"fnCombine,omitempty"`
}

func NewJavascript

func NewJavascript() *Javascript

func (*Javascript) SetFieldNames

func (j *Javascript) SetFieldNames(fieldNames []string) *Javascript

func (*Javascript) SetFnAggregate

func (j *Javascript) SetFnAggregate(fnAggregate string) *Javascript

func (*Javascript) SetFnCombine

func (j *Javascript) SetFnCombine(fnCombine string) *Javascript

func (*Javascript) SetFnReset

func (j *Javascript) SetFnReset(fnReset string) *Javascript

func (*Javascript) SetName

func (j *Javascript) SetName(name string) *Javascript

type LongAny

type LongAny struct {
	Base
	FieldName string `json:"fieldName,omitempty"`
}

func NewLongAny

func NewLongAny() *LongAny

func (*LongAny) SetFieldName

func (l *LongAny) SetFieldName(fieldName string) *LongAny

func (*LongAny) SetName

func (l *LongAny) SetName(name string) *LongAny

type LongFirst

type LongFirst struct {
	Base
	FieldName string `json:"fieldName,omitempty"`
}

func NewLongFirst

func NewLongFirst() *LongFirst

func (*LongFirst) SetFieldName

func (l *LongFirst) SetFieldName(fieldName string) *LongFirst

func (*LongFirst) SetName

func (l *LongFirst) SetName(name string) *LongFirst

type LongLast

type LongLast struct {
	Base
	FieldName string `json:"fieldName,omitempty"`
}

func NewLongLast

func NewLongLast() *LongLast

func (*LongLast) SetFieldName

func (l *LongLast) SetFieldName(fieldName string) *LongLast

func (*LongLast) SetName

func (l *LongLast) SetName(name string) *LongLast

type LongMax

type LongMax struct {
	Base
	FieldName  string `json:"fieldName,omitempty"`
	Expression string `json:"expression,omitempty"`
}

func NewLongMax

func NewLongMax() *LongMax

func (*LongMax) SetExpression

func (l *LongMax) SetExpression(expression string) *LongMax

func (*LongMax) SetFieldName

func (l *LongMax) SetFieldName(fieldName string) *LongMax

func (*LongMax) SetName

func (l *LongMax) SetName(name string) *LongMax

type LongMin

type LongMin struct {
	Base
	FieldName  string `json:"fieldName,omitempty"`
	Expression string `json:"expression,omitempty"`
}

func NewLongMin

func NewLongMin() *LongMin

func (*LongMin) SetExpression

func (l *LongMin) SetExpression(expression string) *LongMin

func (*LongMin) SetFieldName

func (l *LongMin) SetFieldName(fieldName string) *LongMin

func (*LongMin) SetName

func (l *LongMin) SetName(name string) *LongMin

type LongSum

type LongSum struct {
	Base
	FieldName  string `json:"fieldName,omitempty"`
	Expression string `json:"expression,omitempty"`
}

func NewLongSum

func NewLongSum() *LongSum

func (*LongSum) SetExpression

func (l *LongSum) SetExpression(expression string) *LongSum

func (*LongSum) SetFieldName

func (l *LongSum) SetFieldName(fieldName string) *LongSum

func (*LongSum) SetName

func (l *LongSum) SetName(name string) *LongSum

type QuantilesDoublesSketch

type QuantilesDoublesSketch struct {
	Base
	FieldName string `json:"fieldName,omitempty"`
	K         int64  `json:"k,omitempty"`
}

QuantilesDoublesSketch holds the Quantiles Doubles sketch based on https://druid.apache.org/docs/latest/development/extensions-core/datasketches-quantiles.html

func NewQuantilesDoublesSketch

func NewQuantilesDoublesSketch() *QuantilesDoublesSketch

NewQuantilesDoublesSketch create a new instance of QuantilesDoublesSketch with type QuantilesDoublesSketch

func (*QuantilesDoublesSketch) SetFieldName

func (q *QuantilesDoublesSketch) SetFieldName(fieldName string) *QuantilesDoublesSketch

SetFieldName set fieldName

func (*QuantilesDoublesSketch) SetK

SetK set K. The value needs to must be a power of 2 from 2 to 32768

func (*QuantilesDoublesSketch) SetName

SetName set name

type StringAny

type StringAny struct {
	Base
	FieldName      string `json:"fieldName,omitempty"`
	MaxStringBytes int64  `json:"maxStringBytes,omitempty"`
}

func NewStringAny

func NewStringAny() *StringAny

func (*StringAny) SetFieldName

func (s *StringAny) SetFieldName(fieldName string) *StringAny

func (*StringAny) SetMaxStringBytes

func (s *StringAny) SetMaxStringBytes(maxStringBytes int64) *StringAny

func (*StringAny) SetName

func (s *StringAny) SetName(name string) *StringAny

type StringFirst

type StringFirst struct {
	Base
	FieldName      string `json:"fieldName,omitempty"`
	MaxStringBytes int64  `json:"maxStringBytes,omitempty"`
}

func NewStringFirst

func NewStringFirst() *StringFirst

func (*StringFirst) SetFieldName

func (s *StringFirst) SetFieldName(fieldName string) *StringFirst

func (*StringFirst) SetMaxStringBytes

func (s *StringFirst) SetMaxStringBytes(maxStringBytes int64) *StringFirst

func (*StringFirst) SetName

func (s *StringFirst) SetName(name string) *StringFirst

type StringFirstFolding

type StringFirstFolding struct {
	Base
	FieldName      string `json:"fieldName,omitempty"`
	MaxStringBytes int64  `json:"maxStringBytes,omitempty"`
}

func NewStringFirstFolding

func NewStringFirstFolding() *StringFirstFolding

func (*StringFirstFolding) SetFieldName

func (s *StringFirstFolding) SetFieldName(fieldName string) *StringFirstFolding

func (*StringFirstFolding) SetMaxStringBytes

func (s *StringFirstFolding) SetMaxStringBytes(maxStringBytes int64) *StringFirstFolding

func (*StringFirstFolding) SetName

func (s *StringFirstFolding) SetName(name string) *StringFirstFolding

type StringLast

type StringLast struct {
	Base
	FieldName      string `json:"fieldName,omitempty"`
	MaxStringBytes int64  `json:"maxStringBytes,omitempty"`
}

func NewStringLast

func NewStringLast() *StringLast

func (*StringLast) SetFieldName

func (s *StringLast) SetFieldName(fieldName string) *StringLast

func (*StringLast) SetMaxStringBytes

func (s *StringLast) SetMaxStringBytes(maxStringBytes int64) *StringLast

func (*StringLast) SetName

func (s *StringLast) SetName(name string) *StringLast

type StringLastFolding

type StringLastFolding struct {
	Base
	FieldName      string `json:"fieldName,omitempty"`
	MaxStringBytes int64  `json:"maxStringBytes,omitempty"`
}

func NewStringLastFolding

func NewStringLastFolding() *StringLastFolding

func (*StringLastFolding) SetFieldName

func (s *StringLastFolding) SetFieldName(fieldName string) *StringLastFolding

func (*StringLastFolding) SetMaxStringBytes

func (s *StringLastFolding) SetMaxStringBytes(maxStringBytes int64) *StringLastFolding

func (*StringLastFolding) SetName

func (s *StringLastFolding) SetName(name string) *StringLastFolding

type TDigestSketch

type TDigestSketch struct {
	Base
	FieldName   string `json:"fieldName,omitempty"`
	Compression int64  `json:"compression,omitempty"`
}

TDigestSketch holds the tdigest sketch struct based on Aggregator section in https://druid.apache.org/docs/latest/development/extensions-contrib/tdigestsketch-quantiles.html

func NewTDigestSketch

func NewTDigestSketch() *TDigestSketch

NewTDigestSketch create a new instance of TDigestSketch

func (*TDigestSketch) SetCompression

func (t *TDigestSketch) SetCompression(compression int64) *TDigestSketch

SetCompression set tdigest compression

func (*TDigestSketch) SetFieldName

func (t *TDigestSketch) SetFieldName(fieldName string) *TDigestSketch

SetFieldName set fieldName

func (*TDigestSketch) SetName

func (t *TDigestSketch) SetName(name string) *TDigestSketch

SetName set name

type ThetaSketch

type ThetaSketch struct {
	Base
	FieldName          string `json:"fieldName,omitempty"`
	IsInputThetaSketch *bool  `json:"isInputThetaSketch,omitempty"`
	Size               int64  `json:"size,omitempty"`
}

ThetaSketch holds the theta sketch struct based on Aggregator section in http://druid.apache.org/docs/latest/development/extensions-core/datasketches-theta.html

func NewThetaSketch

func NewThetaSketch() *ThetaSketch

NewThetaSketch create a new instance of ThetaSketch

func (*ThetaSketch) SetFieldName

func (t *ThetaSketch) SetFieldName(fieldName string) *ThetaSketch

SetFieldName set fieldName

func (*ThetaSketch) SetIsInputThetaSketch

func (t *ThetaSketch) SetIsInputThetaSketch(isInputThetaSketch bool) *ThetaSketch

SetIsInputThetaSketch set theta isInputThetaSketch

func (*ThetaSketch) SetName

func (t *ThetaSketch) SetName(name string) *ThetaSketch

SetName set name

func (*ThetaSketch) SetSize

func (t *ThetaSketch) SetSize(size int64) *ThetaSketch

SetSize set theta size

Jump to

Keyboard shortcuts

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