Show / Hide Table of Contents

Class InsertIntermediateComputations

Inserts intermeaditate computations for expressions that skip tables.

Inheritance
Object
ChangeDag<Expression, Table, IExpressionVisitor>
ChangeExpressions
InsertIntermediateComputations
Implements
IGenericExpressionVisitor<IEnumerable<Expression>>
IExpressionVisitor
IGenericVisitor<IEnumerable<Expression>>
Inherited Members
ChangeExpressions.CreatedExpressions
ChangeExpressions.Result
ChangeExpressions.Identifier(Expression)
ChangeExpressions.ChangeIdentifier(Expression)
ChangeExpressions.Change(BinaryAggregation)
ChangeExpressions.Change(DataSourceColumn)
ChangeExpressions.Change(Literal)
ChangeExpressions.Change(RuntimeVariable)
ChangeExpressions.Change(UnionExpression)
ChangeExpressions.Change(VectorOperation)
ChangeExpressions.Visit(Aggregand)
ChangeExpressions.Visit(BinaryAggregation)
ChangeExpressions.Visit(BinaryOperation)
ChangeExpressions.Visit(ColumnReference)
ChangeExpressions.Visit(DataSourceColumn)
ChangeExpressions.Visit(Extern)
ChangeExpressions.Visit(Filter)
ChangeExpressions.Visit(JoinKey)
ChangeExpressions.Visit(Literal)
ChangeExpressions.Visit(RuntimeVariable)
ChangeExpressions.Visit(TernaryOperation)
ChangeExpressions.Visit(UnaryAggregation)
ChangeExpressions.Visit(UnaryOperation)
ChangeExpressions.Visit(UnionExpression)
ChangeExpressions.Visit(VectorOperation)
ChangeExpressions.Visit(UnaryWindowFunction)
ChangeDag<Expression, Table, IExpressionVisitor>.Mapping
ChangeDag<Expression, Table, IExpressionVisitor>.Reset()
ChangeDag<Expression, Table, IExpressionVisitor>.Identifier(Expression)
ChangeDag<Expression, Table, IExpressionVisitor>.ChangeIdentifier(Expression)
ChangeDag<Expression, Table, IExpressionVisitor>.ReplaceParent(Expression, Expression, Expression)
ChangeDag<Expression, Table, IExpressionVisitor>.UberVisit<TSubnode>(TSubnode, Func<TSubnode, Expression>)
ChangeDag<Expression, Table, IExpressionVisitor>.UberVisit<TSubnode, TSubidentifier>(TSubnode, Func<TSubnode, Expression>)
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Mangrove.MetricSetTransformers.Normalization
Assembly: MetricSetTransformers.dll
Syntax
public class InsertIntermediateComputations : ChangeExpressions, IGenericExpressionVisitor<IEnumerable<Expression>>, IExpressionVisitor, IGenericVisitor<IEnumerable<Expression>>
Remarks

Skiping tables means having expression dependency a -> c with a in table A, c in table C and table dependency A -> B -> C with some table B. This class would replace the chain a -> c with a -> b -> c with the corresponding expression b from table B.

NOTE: by default, we want to replace aggregations as well. This can only be done if all aggregations are of recursive type as defined by IsRecursive(UnaryAggregation). It will throw an exception if there are non-recursive aggregations. By setting the replaceAggregations flag to false we can prevent replacing any aggregations.

NOTE: expressions of types ColumnReference cannot be replaced if the intermediate tables are of type Aggregation. In such cases it will throw an exception because this should never happen: there is no unique way to pass a ColumnReference through an Aggregation.

For recursive aggregations the replacement works as follows. For example, SUM<User>(R) is replaced by SUM<User>SUM<Session>(R) where R is a page-level signal and the aggregation levels are User-Session-Page.

Constructors

View Source

InsertIntermediateComputations()

Declaration
public InsertIntermediateComputations()
View Source

InsertIntermediateComputations(Func<Expression, Table, Expression, Expression>)

Declaration
public InsertIntermediateComputations(Func<Expression, Table, Expression, Expression> intermediateExpressionsFactory)
Parameters
Type Name Description
Func<Expression, Table, Expression, Expression> intermediateExpressionsFactory

A function describing how to create intermediate expressions on tables. Given a child expression, a table, and the previous expression, it decides what expression to add to that table. If the result of the function is null, no new expressions will be added to the table.

View Source

InsertIntermediateComputations(Func<Expression, Table, Expression, Boolean>)

Use the default rules for inserting intermediate expressions defined by Mangrove.MetricSetTransformers.Normalization.InsertIntermediateComputations.CreateIntermediateExpressionFactory(System.Func{Mangrove.MetricSetSyntaxTree.Expression,Mangrove.MetricSetSyntaxTree.Table,Mangrove.MetricSetSyntaxTree.Expression,System.Boolean}), but modify them to ignore any case when ignore evaluates to true.

Declaration
public InsertIntermediateComputations(Func<Expression, Table, Expression, bool> ignore)
Parameters
Type Name Description
Func<Expression, Table, Expression, Boolean> ignore

When the value is true, all the default rules will be ignored and no expression wouldbe inserted.

Remarks

In some cases, it is beneficial to allow some Expressions to skip Tables. For example, it could give a better perf for a vectorized engine where packing and unpacking the computations is expensive.

Methods

View Source

Change(Aggregand)

Declaration
protected override Expression Change(Aggregand agd)
Parameters
Type Name Description
Aggregand agd
Returns
Type Description
Expression
Overrides
ChangeExpressions.Change(Aggregand)
View Source

Change(BinaryOperation)

Declaration
protected override Expression Change(BinaryOperation b)
Parameters
Type Name Description
BinaryOperation b
Returns
Type Description
Expression
Overrides
ChangeExpressions.Change(BinaryOperation)
View Source

Change(ColumnReference)

Declaration
protected override Expression Change(ColumnReference cr)
Parameters
Type Name Description
ColumnReference cr
Returns
Type Description
Expression
Overrides
ChangeExpressions.Change(ColumnReference)
View Source

Change(Extern)

Declaration
protected override Expression Change(Extern ext)
Parameters
Type Name Description
Extern ext
Returns
Type Description
Expression
Overrides
ChangeExpressions.Change(Extern)
View Source

Change(Filter)

Declaration
protected override Expression Change(Filter f)
Parameters
Type Name Description
Filter f
Returns
Type Description
Expression
Overrides
ChangeExpressions.Change(Filter)
View Source

Change(JoinKey)

Declaration
protected override Expression Change(JoinKey k)
Parameters
Type Name Description
JoinKey k
Returns
Type Description
Expression
Overrides
ChangeExpressions.Change(JoinKey)
View Source

Change(TernaryOperation)

Declaration
protected override Expression Change(TernaryOperation t)
Parameters
Type Name Description
TernaryOperation t
Returns
Type Description
Expression
Overrides
ChangeExpressions.Change(TernaryOperation)
View Source

Change(UnaryAggregation)

Declaration
protected override Expression Change(UnaryAggregation agg)
Parameters
Type Name Description
UnaryAggregation agg
Returns
Type Description
Expression
Overrides
ChangeExpressions.Change(UnaryAggregation)
View Source

Change(UnaryOperation)

Declaration
protected override Expression Change(UnaryOperation u)
Parameters
Type Name Description
UnaryOperation u
Returns
Type Description
Expression
Overrides
ChangeExpressions.Change(UnaryOperation)
View Source

Change(UnaryWindowFunction)

Declaration
protected override Expression Change(UnaryWindowFunction w)
Parameters
Type Name Description
UnaryWindowFunction w
Returns
Type Description
Expression
Overrides
ChangeExpressions.Change(UnaryWindowFunction)

Implements

IGenericExpressionVisitor<T>
IExpressionVisitor
IGenericVisitor<T>

Extension Methods

ObjectExtensions.EventId(Object)
  • View Source
Back to top Generated by DocFX