aggregation

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2019 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Avg

type Avg struct {
	expression.UnaryExpression
}

Avg node to calculate the average from numeric column

func NewAvg

func NewAvg(e sql.Expression) *Avg

NewAvg creates a new Avg node.

func (*Avg) Eval

func (a *Avg) Eval(ctx *sql.Context, buffer sql.Row) (interface{}, error)

Eval implements AggregationExpression interface. (AggregationExpression[Expression]])

func (*Avg) IsNullable

func (a *Avg) IsNullable() bool

IsNullable implements AggregationExpression interface. (AggregationExpression[Expression]])

func (*Avg) Merge

func (a *Avg) Merge(ctx *sql.Context, buffer, partial sql.Row) error

Merge implements AggregationExpression interface. (AggregationExpression)

func (*Avg) NewBuffer

func (a *Avg) NewBuffer() sql.Row

NewBuffer implements AggregationExpression interface. (AggregationExpression)

func (*Avg) Resolved

func (a *Avg) Resolved() bool

Resolved implements AggregationExpression interface. (AggregationExpression[Expression[Resolvable]]])

func (*Avg) String

func (a *Avg) String() string

func (*Avg) TransformUp

func (a *Avg) TransformUp(f sql.TransformExprFunc) (sql.Expression, error)

TransformUp implements AggregationExpression interface.

func (*Avg) Type

func (a *Avg) Type() sql.Type

Type implements AggregationExpression interface. (AggregationExpression[Expression]])

func (*Avg) Update

func (a *Avg) Update(ctx *sql.Context, buffer, row sql.Row) error

Update implements AggregationExpression interface. (AggregationExpression)

type Count

type Count struct {
	expression.UnaryExpression
}

Count node to count how many rows are in the result set.

func NewCount

func NewCount(e sql.Expression) *Count

NewCount creates a new Count node.

func (*Count) Eval

func (c *Count) Eval(ctx *sql.Context, buffer sql.Row) (interface{}, error)

Eval implements the Aggregation interface.

func (*Count) IsNullable

func (c *Count) IsNullable() bool

IsNullable returns whether the return value can be null.

func (*Count) Merge

func (c *Count) Merge(ctx *sql.Context, buffer, partial sql.Row) error

Merge implements the Aggregation interface.

func (*Count) NewBuffer

func (c *Count) NewBuffer() sql.Row

NewBuffer creates a new buffer for the aggregation.

func (*Count) Resolved

func (c *Count) Resolved() bool

Resolved implements the Expression interface.

func (*Count) String

func (c *Count) String() string

func (*Count) TransformUp

func (c *Count) TransformUp(f sql.TransformExprFunc) (sql.Expression, error)

TransformUp implements the Expression interface.

func (*Count) Type

func (c *Count) Type() sql.Type

Type returns the type of the result.

func (*Count) Update

func (c *Count) Update(ctx *sql.Context, buffer, row sql.Row) error

Update implements the Aggregation interface.

type Max

type Max struct {
	expression.UnaryExpression
}

Max agregation returns the greatest value of the selected column. It implements the Aggregation interface

func NewMax

func NewMax(e sql.Expression) *Max

NewMax returns a new Max node.

func (*Max) Eval

func (m *Max) Eval(ctx *sql.Context, buffer sql.Row) (interface{}, error)

Eval implements the Aggregation interface.

func (*Max) IsNullable

func (m *Max) IsNullable() bool

IsNullable returns whether the return value can be null.

func (*Max) Merge

func (m *Max) Merge(ctx *sql.Context, buffer, partial sql.Row) error

Merge implements the Aggregation interface.

func (*Max) NewBuffer

func (m *Max) NewBuffer() sql.Row

NewBuffer creates a new buffer to compute the result.

func (*Max) Resolved

func (m *Max) Resolved() bool

Resolved implements the Resolvable interface.

func (*Max) String

func (m *Max) String() string

func (*Max) TransformUp

func (m *Max) TransformUp(f sql.TransformExprFunc) (sql.Expression, error)

TransformUp implements the Transformable interface.

func (*Max) Type

func (m *Max) Type() sql.Type

Type returns the resultant type of the aggregation.

func (*Max) Update

func (m *Max) Update(ctx *sql.Context, buffer, row sql.Row) error

Update implements the Aggregation interface.

type Min

type Min struct {
	expression.UnaryExpression
}

Min aggregation returns the smallest value of the selected column. It implements the Aggregation interface

func NewMin

func NewMin(e sql.Expression) *Min

NewMin creates a new Min node.

func (*Min) Eval

func (m *Min) Eval(ctx *sql.Context, buffer sql.Row) (interface{}, error)

Eval implements the Aggregation interface

func (*Min) IsNullable

func (m *Min) IsNullable() bool

IsNullable returns whether the return value can be null.

func (*Min) Merge

func (m *Min) Merge(ctx *sql.Context, buffer, partial sql.Row) error

Merge implements the Aggregation interface.

func (*Min) NewBuffer

func (m *Min) NewBuffer() sql.Row

NewBuffer creates a new buffer to compute the result.

func (*Min) Resolved

func (m *Min) Resolved() bool

Resolved implements the Resolvable interface.

func (*Min) String

func (m *Min) String() string

func (*Min) TransformUp

func (m *Min) TransformUp(f sql.TransformExprFunc) (sql.Expression, error)

TransformUp implements the Transformable interface.

func (*Min) Type

func (m *Min) Type() sql.Type

Type returns the resultant type of the aggregation.

func (*Min) Update

func (m *Min) Update(ctx *sql.Context, buffer, row sql.Row) error

Update implements the Aggregation interface.

type Sum

type Sum struct {
	expression.UnaryExpression
}

Sum agregation returns the sum of all values in the selected column. It implements the Aggregation interface.

func NewSum

func NewSum(e sql.Expression) *Sum

NewSum returns a new Sum node.

func (*Sum) Eval

func (m *Sum) Eval(ctx *sql.Context, buffer sql.Row) (interface{}, error)

Eval implements the Aggregation interface.

func (*Sum) Merge

func (m *Sum) Merge(ctx *sql.Context, buffer, partial sql.Row) error

Merge implements the Aggregation interface.

func (*Sum) NewBuffer

func (m *Sum) NewBuffer() sql.Row

NewBuffer creates a new buffer to compute the result.

func (*Sum) String

func (m *Sum) String() string

func (*Sum) TransformUp

func (m *Sum) TransformUp(f sql.TransformExprFunc) (sql.Expression, error)

TransformUp implements the Transformable interface.

func (*Sum) Type

func (m *Sum) Type() sql.Type

Type returns the resultant type of the aggregation.

func (*Sum) Update

func (m *Sum) Update(ctx *sql.Context, buffer, row sql.Row) error

Update implements the Aggregation interface.

Jump to

Keyboard shortcuts

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