Skip to main content

Class: Calculation

Defined in: packages/core/src/plan/operators/item/calculation.ts:20

A scalar expression built from literals, function calls, identifiers, and sub-operators.

During execution each PlanOperator in args is evaluated to an array of values that is passed positionally to impl.

Implements

Constructors

Constructor

new Calculation(lang, impl, args, argMeta, original?, aggregates?, literal?): Calculation

Defined in: packages/core/src/plan/operators/item/calculation.ts:24

Parameters

ParameterTypeDefault valueDescription
langLowercase<string>undefinedPlanOperator.lang
impl(...args) => anyundefinedScalar function that computes the expression result from the evaluated arguments.
argsOpOrId[]undefinedargs which are plan operators will be instantiated as arrays during execution
argMetaArgMeta[]undefinedMetadata parallel to args; describes the origin of each argument in the original AST.
original?PlanOperatorundefinedOriginal plan operator this calculation was derived from, if any.
aggregates?AggregateCall[][]Aggregate sub-expressions embedded in this calculation.
literal?booleanfalsetrue when the expression is a compile-time constant with no sub-operators.

Returns

Calculation

Properties

aggregates

aggregates: AggregateCall[] = []

Defined in: packages/core/src/plan/operators/item/calculation.ts:36

Aggregate sub-expressions embedded in this calculation.


argMeta

argMeta: ArgMeta[]

Defined in: packages/core/src/plan/operators/item/calculation.ts:32

Metadata parallel to args; describes the origin of each argument in the original AST.


args

args: OpOrId[]

Defined in: packages/core/src/plan/operators/item/calculation.ts:30

args which are plan operators will be instantiated as arrays during execution


impl

impl: (...args) => any

Defined in: packages/core/src/plan/operators/item/calculation.ts:28

Scalar function that computes the expression result from the evaluated arguments.

Parameters

ParameterType
...argsany[]

Returns

any


lang

lang: Lowercase<string>

Defined in: packages/core/src/plan/operators/item/calculation.ts:26

PlanOperator.lang

Implementation of

PlanOperator.lang


literal

literal: boolean = false

Defined in: packages/core/src/plan/operators/item/calculation.ts:38

true when the expression is a compile-time constant with no sub-operators.


original?

optional original?: PlanOperator

Defined in: packages/core/src/plan/operators/item/calculation.ts:34

Original plan operator this calculation was derived from, if any.


parent

parent: PlanOperator

Defined in: packages/core/src/plan/operators/item/calculation.ts:22

PlanOperator.parent

Implementation of

PlanOperator.parent

Methods

accept()

accept<Ret, Arg>(visitors, arg?): Ret

Defined in: packages/core/src/plan/operators/item/calculation.ts:45

PlanOperator.accept

Type Parameters

Type Parameter
Ret
Arg

Parameters

ParameterType
visitorsRecord<string, PlanVisitor<Ret, Arg>>
arg?Arg

Returns

Ret

Implementation of

PlanOperator.accept


clone()

clone(): Calculation

Defined in: packages/core/src/plan/operators/item/calculation.ts:87

PlanOperator.clone

Returns

Calculation

Implementation of

PlanOperator.clone


getChildren()

getChildren(): PlanOperator[]

Defined in: packages/core/src/plan/operators/item/calculation.ts:76

PlanOperator.getChildren

Returns

PlanOperator[]

Implementation of

PlanOperator.getChildren


getDependencies()

getDependencies(): IdSet

Defined in: packages/core/src/plan/operators/item/calculation.ts:133

PlanOperator.getDependencies

Returns

IdSet

Implementation of

PlanOperator.getDependencies


replaceChild()

replaceChild(current, replacement): void

Defined in: packages/core/src/plan/operators/item/calculation.ts:52

PlanOperator.replaceChild

Parameters

ParameterType
currentPlanOperator
replacementPlanOperator

Returns

void

Implementation of

PlanOperator.replaceChild