Ejemplo n.º 1
0
        public override RowSet RowSet(STransaction tr, SQuery top, SDict <long, SFunction> ags, Context cx)
        {
            for (var b = order.First(); b != null; b = b.Next())
            {
                ags = b.Value.col.Aggregates(ags, cx);
            }
            var ags1 = ags;

            for (var b = cpos.First(); b != null; b = b.Next())
            {
                ags1 = b.Value.Item2.Aggregates(ags1, cx);
            }
            RowSet r = new SelectRowSet(qry.RowSet(tr, this, ags1, cx), this, ags, cx);

            // perform another pass on the selectlist just in case
            if (!(qry is SGroupQuery))
            {
                for (var b = cpos.First(); b != null; b = b.Next())
                {
                    ags = b.Value.Item2.Aggregates(ags, cx);
                }
                if (ags.Length != 0)
                {
                    r = new EvalRowSet(((SelectRowSet)r)._source, this, ags, cx);
                }
            }
            if (distinct)
            {
                r = new DistinctRowSet(r);
            }
            if (order.Length != 0)
            {
                r = new OrderedRowSet(r, this, cx);
            }
            return(r);
        }
Ejemplo n.º 2
0
 internal static DistinctRowBookmark?New(DistinctRowSet drs)
 {
     return((drs.rows.First() is Bookmark <ValueTuple <SRow, bool> > rb) ?
            new DistinctRowBookmark(drs, rb, 0) : null);
 }
Ejemplo n.º 3
0
 DistinctRowBookmark(DistinctRowSet drs, Bookmark <ValueTuple <SRow, bool> > bmk, int pos)
     : base(drs, bmk.Value.Item1, pos)
 {
     _drs = drs; _bmk = bmk;
 }