Ejemplo n.º 1
0
        /// <inheritdoc cref="ScanShareableAnalyzer{S,M}.AggregationFunctions"/>
        public override IEnumerable <Column> AggregationFunctions()
        {
            Column summarization = Sum(AnalyzersExt.ConditionalSelection(Column, Where)
                                       .IsNotNull()
                                       .Cast("int"));

            Column conditional = AnalyzersExt.ConditionalCount(Where);

            return(new[] { summarization, conditional });
        }
Ejemplo n.º 2
0
        /// <inheritdoc cref="ScanShareableAnalyzer{S,M}.AggregationFunctions"/>
        public override IEnumerable <Column> AggregationFunctions()
        {
            Column expression =
                When(RegexpExtract(Column(Column.GetOrElse(string.Empty)), Regex.ToString(), 0) != Lit(""), 1)
                .Otherwise(0);

            Column summation = Sum(AnalyzersExt.ConditionalSelection(expression, Where).Cast("integer"));

            return(new[] { summation, AnalyzersExt.ConditionalCount(Where) });
        }
Ejemplo n.º 3
0
        /// <inheritdoc cref="ScanShareableAnalyzer{S,M}.AggregationFunctions" />
        public override IEnumerable <Column> AggregationFunctions()
        {
            //https://mathoverflow.net/a/57914
            var firstSelection  = AnalyzersExt.ConditionalSelection(ColumnA, Where);
            var secondSelection = AnalyzersExt.ConditionalSelection(ColumnB, Where);

            var count = Count(firstSelection);
            var sumX  = Sum(firstSelection);
            var sumY  = Sum(secondSelection);
            var sumXY = Sum(firstSelection * secondSelection);
            var sumX2 = Sum(firstSelection * firstSelection);
            var sumY2 = Sum(secondSelection * secondSelection);

            //double n, double sumX, double sumY, double sumXY, double sumX2, double sumY2
            return(new[] { count, sumX, sumY, sumXY, sumX2, sumY2 });
        }
Ejemplo n.º 4
0
        public override IEnumerable <Column> AggregationFunctions()
        {
            Column selection = AnalyzersExt.ConditionalSelection(Predicate, Where);

            return(new[] { selection, Count("*") }.AsEnumerable());
        }
Ejemplo n.º 5
0
 /// <inheritdoc cref="StandardScanShareableAnalyzer{S}.AggregationFunctions"/>
 public override IEnumerable <Column> AggregationFunctions() =>
 new[] { Sum(AnalyzersExt.ConditionalSelection(Column, Where)).Cast("double") };
Ejemplo n.º 6
0
        /// <inheritdoc cref="ScanShareableAnalyzer{S,M}.AggregationFunctions"/>
        public override IEnumerable <Column> AggregationFunctions()
        {
            Column summation = Sum(AnalyzersExt.ConditionalSelection(Predicate, Where).Cast("int"));

            return(new[] { summation, AnalyzersExt.ConditionalCount(Where) });
        }
Ejemplo n.º 7
0
        /// <inheritdoc cref="StandardScanShareableAnalyzer{S}.AggregationFunctions"/>
        public override IEnumerable <Column> AggregationFunctions()
        {
            Column col = AnalyzersExt.ConditionalSelection(Expr(Column.GetOrElse(string.Empty)), Where);

            return(new[] { Struct(Count(col), Avg(col), StddevPop(col)) });
        }
Ejemplo n.º 8
0
 /// <inheritdoc cref="ScanShareableAnalyzer{S,M}.AggregationFunctions"/>.
 public override IEnumerable <Column> AggregationFunctions() =>
 new[] { AnalyzersExt.ConditionalSelection(Column, Where) };