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
| Parameter | Type | Default value | Description |
|---|---|---|---|
lang | Lowercase<string> | undefined | PlanOperator.lang |
impl | (...args) => any | undefined | Scalar function that computes the expression result from the evaluated arguments. |
args | OpOrId[] | undefined | args which are plan operators will be instantiated as arrays during execution |
argMeta | ArgMeta[] | undefined | Metadata parallel to args; describes the origin of each argument in the original AST. |
original? | PlanOperator | undefined | Original plan operator this calculation was derived from, if any. |
aggregates? | AggregateCall[] | [] | Aggregate sub-expressions embedded in this calculation. |
literal? | boolean | false | true 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
| Parameter | Type |
|---|---|
...args | any[] |
Returns
any
lang
lang:
Lowercase<string>
Defined in: packages/core/src/plan/operators/item/calculation.ts:26
PlanOperator.lang
Implementation of
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?
optionaloriginal?: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
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
| Parameter | Type |
|---|---|
visitors | Record<string, PlanVisitor<Ret, Arg>> |
arg? | Arg |
Returns
Ret
Implementation of
clone()
clone():
Calculation
Defined in: packages/core/src/plan/operators/item/calculation.ts:87
PlanOperator.clone
Returns
Calculation
Implementation of
getChildren()
getChildren():
PlanOperator[]
Defined in: packages/core/src/plan/operators/item/calculation.ts:76
PlanOperator.getChildren
Returns
Implementation of
getDependencies()
getDependencies():
IdSet
Defined in: packages/core/src/plan/operators/item/calculation.ts:133
PlanOperator.getDependencies
Returns
Implementation of
replaceChild()
replaceChild(
current,replacement):void
Defined in: packages/core/src/plan/operators/item/calculation.ts:52
PlanOperator.replaceChild
Parameters
| Parameter | Type |
|---|---|
current | PlanOperator |
replacement | PlanOperator |
Returns
void