@@ -45,18 +45,26 @@ INSERT INTO mm_float VALUES
4545 (12 , 8 , double(' Infinity' ), float(' Infinity' )),
4646 (13 , 8 , double(' NaN' ), float(' NaN' ))
4747
48- -- Without grouping
48+ -- Without grouping. The extrema are NaN and infinities, so scan/merge order cannot change them.
4949query
5050SELECT max (d), min (d), max (- d), min (- d), max (f), min (f), max (- f), min (- f) FROM mm_float
5151
52- -- Of equal values the first one seen wins
52+ -- Signed-zero ties need an explicit input order, not just an ORDER BY on the aggregate result.
53+ -- Use windows for groups 2 and 3: neither file layout nor partial-aggregate merge order is fixed.
54+ -- The native accumulator tests check first-value preservation by bits for ordinary and grouped
55+ -- aggregates, including partial-state merges.
5356query
54- SELECT max (d), min (d), max (- d), min (- d), max (f), min (f) FROM mm_float WHERE g IN (2 , 3 )
57+ SELECT id, g,
58+ max (d) OVER w, min (d) OVER w, max (- d) OVER w, min (- d) OVER w,
59+ max (f) OVER w, min (f) OVER w, max (- f) OVER w, min (- f) OVER w
60+ FROM mm_float WHERE g IN (2 , 3 )
61+ WINDOW w AS (PARTITION BY g ORDER BY id ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
5562
56- -- Grouped. Groups 4 and 5 hold only an infinity, group 6 only NaN and group 7 only NULL.
63+ -- Grouped, excluding the order-sensitive signed-zero groups. Groups 4 and 5 hold only an
64+ -- infinity, group 6 only NaN and group 7 only NULL.
5765query
5866SELECT g, max (d), min (d), max (- d), min (- d), max (f), min (f), max (- f), min (- f)
59- FROM mm_float GROUP BY g ORDER BY g
67+ FROM mm_float WHERE g NOT IN ( 2 , 3 ) GROUP BY g ORDER BY g
6068
6169-- Window frames: growing, sliding and the whole partition. Each frame is ordered by id, so the
6270-- first of two equal values is well defined. The sliding frames use FOLLOWING offsets because the
0 commit comments