Class: AttributeRenameChecker
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:28
Verifies whether renaming attributes in the plan is safe.
Extended by
Implements
PlanVisitor<boolean,ArcDescentArgs>
Constructors
Constructor
new AttributeRenameChecker(
vmap,db):AttributeRenameChecker
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:35
Parameters
| Parameter | Type | Description |
|---|---|---|
vmap | Record<string, PlanVisitor<boolean, ArcDescentArgs>> | Per-language visitor map used for recursive descent. |
db | DortDBAsFriend | Database instance providing access to the language manager. |
Returns
AttributeRenameChecker
Properties
db
protecteddb:DortDBAsFriend
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:39
Database instance providing access to the language manager.
tdepsVmap
protectedtdepsVmap:Record<string,TransitiveDependencies>
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:33
Per-language TransitiveDependencies visitor map, used to detect rename conflicts.
vmap
protectedvmap:Record<string,PlanVisitor<boolean,ArcDescentArgs>>
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:37
Per-language visitor map used for recursive descent.
Methods
canRename()
canRename(
plan,renamesInv):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:48
Returns true if applying args (an inverse rename map) to plan is safe,
i.e. no attribute referenced in the subtree would be ambiguously renamed.
Parameters
| Parameter | Type |
|---|---|
plan | PlanOperator |
renamesInv | RenameMap |
Returns
boolean
checkAttrs()
protectedcheckAttrs(attrs,verticalCtx,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:98
Verifies that none of the projection attrs has its output identifier in args
(unless it is a trivial identity alias), and that all computed attr expressions pass
the horizontal rename check.
Parameters
| Parameter | Type |
|---|---|
attrs | Aliased<Calculation | ASTIdentifier>[] |
verticalCtx | IdSet |
args | ArcDescentArgs |
Returns
boolean
checkHorizontal()
protectedcheckHorizontal(horizontal,verticalCtx,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:59
Checks whether horizontal (an expression computed from the current row) can be
safely renamed: its transitive dependencies outside verticalCtx must not overlap with
any renamed attribute, and the expression itself must pass the rename check.
Parameters
| Parameter | Type |
|---|---|
horizontal | PlanOperator |
verticalCtx | IdSet |
args | ArcDescentArgs |
Returns
boolean
checkHorizontalArray()
protectedcheckHorizontalArray(horizontal,verticalCtx,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:78
Calls checkHorizontal for every non-identifier element of horizontal,
returning false as soon as any element fails the rename check.
Parameters
| Parameter | Type |
|---|---|
horizontal | OpOrId[] |
verticalCtx | IdSet |
args | ArcDescentArgs |
Returns
boolean
checkVerticalArray()
protectedcheckVerticalArray(vertical,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:116
Calls the rename check for every non-identifier element of vertical (expression
arguments), returning false as soon as any element fails.
Parameters
| Parameter | Type |
|---|---|
vertical | OpOrId[] |
args | ArcDescentArgs |
Returns
boolean
visitAggregate()
visitAggregate(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:289
Parameters
| Parameter | Type |
|---|---|
operator | AggregateCall |
args | ArcDescentArgs |
Returns
boolean
Implementation of
visitBidirectionalRecursion()
visitBidirectionalRecursion(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:328
Parameters
| Parameter | Type |
|---|---|
operator | BidirectionalRecursion |
args | ArcDescentArgs |
Returns
boolean
Implementation of
PlanVisitor.visitBidirectionalRecursion
visitCalculation()
visitCalculation(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:172
Parameters
| Parameter | Type |
|---|---|
operator | Calculation |
args | ArcDescentArgs |
Returns
boolean
Implementation of
visitCartesianProduct()
visitCartesianProduct(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:184
Parameters
| Parameter | Type |
|---|---|
operator | CartesianProduct |
args | ArcDescentArgs |
Returns
boolean
Implementation of
PlanVisitor.visitCartesianProduct
visitConditional()
visitConditional(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:175
Parameters
| Parameter | Type |
|---|---|
operator | Conditional |
args | ArcDescentArgs |
Returns
boolean
Implementation of
visitDifference()
visitDifference(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:270
Parameters
| Parameter | Type |
|---|---|
operator | Difference |
args | ArcDescentArgs |
Returns
boolean
Implementation of
visitDistinct()
visitDistinct(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:273
Parameters
| Parameter | Type |
|---|---|
operator | Distinct |
args | ArcDescentArgs |
Returns
boolean
Implementation of
visitFnCall()
visitFnCall(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:163
Parameters
| Parameter | Type |
|---|---|
operator | FnCall |
args | ArcDescentArgs |
Returns
boolean
Implementation of
visitGroupBy()
visitGroupBy(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:238
Parameters
| Parameter | Type |
|---|---|
operator | GroupBy |
args | ArcDescentArgs |
Returns
boolean
Implementation of
visitIndexedRecursion()
visitIndexedRecursion(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:314
Parameters
| Parameter | Type |
|---|---|
operator | IndexedRecursion |
args | ArcDescentArgs |
Returns
boolean
Implementation of
PlanVisitor.visitIndexedRecursion
visitIndexScan()
visitIndexScan(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:311
Parameters
| Parameter | Type |
|---|---|
operator | IndexScan |
args | ArcDescentArgs |
Returns
boolean
Implementation of
visitIntersection()
visitIntersection(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:264
Parameters
| Parameter | Type |
|---|---|
operator | Intersection |
args | ArcDescentArgs |
Returns
boolean
Implementation of
visitItemFnSource()
visitItemFnSource(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:296
Parameters
| Parameter | Type |
|---|---|
operator | ItemFnSource |
args | ArcDescentArgs |
Returns
boolean
Implementation of
visitItemSource()
visitItemSource(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:160
Parameters
| Parameter | Type |
|---|---|
operator | ItemSource |
args | ArcDescentArgs |
Returns
boolean
Implementation of
visitJoin()
visitJoin(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:193
Parameters
| Parameter | Type |
|---|---|
operator | Join |
args | ArcDescentArgs |
Returns
boolean
Implementation of
visitLimit()
visitLimit(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:249
Parameters
| Parameter | Type |
|---|---|
operator | Limit |
args | ArcDescentArgs |
Returns
boolean
Implementation of
visitLiteral()
visitLiteral(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:169
Parameters
| Parameter | Type |
|---|---|
operator | Literal |
args | ArcDescentArgs |
Returns
boolean
Implementation of
visitMapFromItem()
visitMapFromItem(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:214
Parameters
| Parameter | Type |
|---|---|
operator | MapFromItem |
args | ArcDescentArgs |
Returns
boolean
Implementation of
visitMapToItem()
visitMapToItem(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:211
Parameters
| Parameter | Type |
|---|---|
operator | MapToItem |
args | ArcDescentArgs |
Returns
boolean
Implementation of
visitNullSource()
visitNullSource(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:286
Parameters
| Parameter | Type |
|---|---|
operator | NullSource |
args | ArcDescentArgs |
Returns
boolean
Implementation of
visitOrderBy()
visitOrderBy(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:229
Parameters
| Parameter | Type |
|---|---|
operator | OrderBy |
args | ArcDescentArgs |
Returns
boolean
Implementation of
visitProjection()
visitProjection(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:142
Parameters
| Parameter | Type |
|---|---|
operator | Projection |
args | ArcDescentArgs |
Returns
boolean
Implementation of
visitProjectionConcat()
visitProjectionConcat(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:202
Parameters
| Parameter | Type |
|---|---|
operator | ProjectionConcat |
args | ArcDescentArgs |
Returns
boolean
Implementation of
PlanVisitor.visitProjectionConcat
visitProjectionIndex()
visitProjectionIndex(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:220
Parameters
| Parameter | Type |
|---|---|
operator | ProjectionIndex |
args | ArcDescentArgs |
Returns
boolean
Implementation of
PlanVisitor.visitProjectionIndex
visitQuantifier()
visitQuantifier(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:308
Parameters
| Parameter | Type |
|---|---|
operator | Quantifier |
args | ArcDescentArgs |
Returns
boolean
Implementation of
visitRecursion()
visitRecursion(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:127
Parameters
| Parameter | Type |
|---|---|
operator | Recursion |
args | ArcDescentArgs |
Returns
boolean
Implementation of
visitSelection()
visitSelection(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:148
Parameters
| Parameter | Type |
|---|---|
operator | Selection |
args | ArcDescentArgs |
Returns
boolean
Implementation of
visitSetOp()
protectedvisitSetOp(operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:252
Parameters
| Parameter | Type |
|---|---|
operator | SetOperator |
args | ArcDescentArgs |
Returns
boolean
visitTupleFnSource()
visitTupleFnSource(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:302
Parameters
| Parameter | Type |
|---|---|
operator | TupleFnSource |
args | ArcDescentArgs |
Returns
boolean
Implementation of
PlanVisitor.visitTupleFnSource
visitTupleSource()
visitTupleSource(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:157
Parameters
| Parameter | Type |
|---|---|
operator | TupleSource |
args | ArcDescentArgs |
Returns
boolean
Implementation of
visitUnion()
visitUnion(
operator,args):boolean
Defined in: packages/core/src/visitors/attribute-rename-checker.ts:261
Parameters
| Parameter | Type |
|---|---|
operator | Union |
args | ArcDescentArgs |
Returns
boolean