Skip to content

Commit 31fa60f

Browse files
committed
test: cover order-insensitive aggregates with an ORDER BY and no GROUP BY
Run the same eight aggregates without GROUP BY, filtered so that the plan has a Partial and a Final aggregate.
1 parent 21666e9 commit 31fa60f

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎datafusion/sqllogictest/test_files/group_by.slt‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2949,6 +2949,22 @@ FROM insensitive_order_by GROUP BY g ORDER BY g;
29492949
1 4.5 2 7 5 4.5 2.25 1.5 2.1213
29502950
2 11 8 14 6 2 1 1 1.4142
29512951

2952+
# The same aggregates without GROUP BY. The filter splits the input across
2953+
# partitions, so this runs as a Partial and a Final aggregate.
2954+
query RIIIRRRR
2955+
SELECT
2956+
avg(v ORDER BY k),
2957+
bit_and(v ORDER BY k),
2958+
bit_or(v ORDER BY k),
2959+
bit_xor(v ORDER BY k),
2960+
var_samp(v ORDER BY k),
2961+
var_pop(v ORDER BY k),
2962+
round(stddev_pop(v ORDER BY k), 4),
2963+
round(stddev(v ORDER BY k), 4)
2964+
FROM insensitive_order_by WHERE v > 0;
2965+
----
2966+
7.75 0 15 3 16.25 12.1875 3.4911 4.0311
2967+
29522968
statement ok
29532969
DROP TABLE insensitive_order_by;
29542970

0 commit comments

Comments
 (0)