Class AdjustConstantDependencies
Ensures for any Expression depending on a Literal or a RuntimeVariable, that Literal or RuntimeVariable is in the "topmost" possible Table closest to it. "Topmost" means the the Table right below the first Aggregation in the table path.
Inheritance
AdjustConstantDependencies
Implements
Inherited Members
Namespace: Mangrove.MetricSetTransformers.Normalization
Assembly: MetricSetTransformers.dll
Syntax
public class AdjustConstantDependencies : ChangeExpressions, IGenericExpressionVisitor<IEnumerable<Expression>>, IExpressionVisitor, IGenericVisitor<IEnumerable<Expression>>
Remarks
Literals and RuntimeVariables are conceptually "global" objects in the sense that they don't have any conceptual coupling with the Tables they belong to, as long as they are all within the same aggregation level.
In particular, this transformer is needed to avoid situations like SUM(1) with the constant 1 being several non-aggregation tables below: we don't want to create additional ColumnReferences to wrap that "1" to avoid bloating the output schema of that Table.
Methods
View SourceReplaceParent(Expression, Expression, Expression)
Declaration
protected override Expression ReplaceParent(Expression expr, Expression oldParent, Expression newParent)
Parameters
Type | Name | Description |
---|---|---|
Expression | expr | |
Expression | oldParent | |
Expression | newParent |
Returns
Type | Description |
---|---|
Expression |
Overrides
Mangrove.MetricSetTransformers.Utilities.ChangeDag<Mangrove.MetricSetSyntaxTree.Expression, Mangrove.MetricSetSyntaxTree.Table, Mangrove.MetricSetSyntaxTree.IExpressionVisitor>.ReplaceParent(Mangrove.MetricSetSyntaxTree.Expression, Mangrove.MetricSetSyntaxTree.Expression, Mangrove.MetricSetSyntaxTree.Expression)