Namespace Mangrove.MetricSetTransformers.Normalization
Classes
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.
CoalesceOutputTables
Transformer that combines all the Expression nodes from all the output Table into a single output Table whose source is an experiment unit-level Table.
EnsureDenominatorIsTypeDouble
For any BinaryOperation with Divide, apply Mangrove.MetricSetTransformers.Internal.Arithmetic.EnsureTypeDouble(Mangrove.MetricSetSyntaxTree.Expression) to the denominator. Mangrove makes the assumption that number division is non-integer, so for any a/b with a and b both integer, we need to explicitly cast b to type double.
For example, if a literal is of type double but the value is specified as "1", in the generated script it would simply be "1", and so for example if the script has a division 1/SUM(integer value), this division will be incorrectly treated as INTEGER division and NOT DOUBLE division, which would result in the value 0.
InsertColumnReferences
Inserts column references between tables whenever required.
InsertIntermediateComputations
Inserts intermeaditate computations for expressions that skip tables.
InsertIntermediateSkipNonExperimentUnitAggregations
This transformer modifies the rules of InsertIntermediateComputations by only inserting intermediate UnaryAggregations for experiment unit Aggregation tables, as defined by ExperimentUnitTables(MetricsPlan).
NormalizeColumnReferenceDependencies
Finds expressions which depend on other column references within the same table and removes the dependency within the table.
NullSafeStringMatch
In C#, string matching would throw an exception for null strings. To prevent that, we make sure to only apply StringMatches to non-null strings.
ReplaceNonRecursiveAggregations
Replace unit aggregations of non-recursive type (e.g. AVG, COUNT, ...) with recursive aggregations.
ShortcircuitExpressions
Remove operations when knowledge about the nullity of Expression nodes allows this.
Enums
ReplaceNonRecursiveAggregations.ReplacementFlags
Enumeration of different instructions on when and how to replace certain aggregations. It does not have 0 value following https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/enum#designing-flag-enums.