@@ -2329,15 +2329,15 @@ ProjectionExec: expr=[country@0 as country, ARRAY_AGG(s.amount) ORDER BY [s.amou
23292329----SortExec: expr=[amount@1 DESC]
23302330------MemoryExec: partitions=1, partition_sizes=[1]
23312331
2332- query T?R
2332+ query T?R rowsort
23332333SELECT s.country, ARRAY_AGG(s.amount ORDER BY s.amount DESC) AS amounts,
23342334 SUM(s.amount) AS sum1
23352335 FROM sales_global AS s
23362336 GROUP BY s.country
23372337----
23382338FRA [200.0, 50.0] 250
2339- TUR [100.0, 75.0] 175
23402339GRC [80.0, 30.0] 110
2340+ TUR [100.0, 75.0] 175
23412341
23422342# test_ordering_sensitive_aggregation3
23432343# When different aggregators have conflicting requirements, we cannot satisfy all of them in current implementation.
@@ -2373,7 +2373,7 @@ ProjectionExec: expr=[country@0 as country, ARRAY_AGG(s.amount) ORDER BY [s.amou
23732373----SortExec: expr=[country@0 ASC NULLS LAST,amount@1 DESC]
23742374------MemoryExec: partitions=1, partition_sizes=[1]
23752375
2376- query T?R
2376+ query T?R rowsort
23772377SELECT s.country, ARRAY_AGG(s.amount ORDER BY s.amount DESC) AS amounts,
23782378 SUM(s.amount) AS sum1
23792379 FROM (SELECT *
@@ -2409,7 +2409,7 @@ ProjectionExec: expr=[country@0 as country, zip_code@1 as zip_code, ARRAY_AGG(s.
24092409----SortExec: expr=[country@1 ASC NULLS LAST,amount@2 DESC]
24102410------MemoryExec: partitions=1, partition_sizes=[1]
24112411
2412- query TI?R
2412+ query TI?R rowsort
24132413SELECT s.country, s.zip_code, ARRAY_AGG(s.amount ORDER BY s.amount DESC) AS amounts,
24142414 SUM(s.amount) AS sum1
24152415 FROM (SELECT *
@@ -2445,7 +2445,7 @@ ProjectionExec: expr=[country@0 as country, ARRAY_AGG(s.amount) ORDER BY [s.coun
24452445----SortExec: expr=[country@0 ASC NULLS LAST]
24462446------MemoryExec: partitions=1, partition_sizes=[1]
24472447
2448- query T?R
2448+ query T?R rowsort
24492449SELECT s.country, ARRAY_AGG(s.amount ORDER BY s.amount DESC) AS amounts,
24502450 SUM(s.amount) AS sum1
24512451 FROM (SELECT *
@@ -2480,7 +2480,7 @@ ProjectionExec: expr=[country@0 as country, ARRAY_AGG(s.amount) ORDER BY [s.coun
24802480----SortExec: expr=[country@0 ASC NULLS LAST,amount@1 DESC]
24812481------MemoryExec: partitions=1, partition_sizes=[1]
24822482
2483- query T?R
2483+ query T?R rowsort
24842484SELECT s.country, ARRAY_AGG(s.amount ORDER BY s.country DESC, s.amount DESC) AS amounts,
24852485 SUM(s.amount) AS sum1
24862486 FROM (SELECT *
@@ -2512,16 +2512,16 @@ ProjectionExec: expr=[country@0 as country, ARRAY_AGG(sales_global.amount) ORDER
25122512----SortExec: expr=[amount@1 DESC]
25132513------MemoryExec: partitions=1, partition_sizes=[1]
25142514
2515- query T?RR
2515+ query T?RR rowsort
25162516SELECT country, ARRAY_AGG(amount ORDER BY amount DESC) AS amounts,
25172517 FIRST_VALUE(amount ORDER BY amount ASC) AS fv1,
25182518 LAST_VALUE(amount ORDER BY amount DESC) AS fv2
25192519 FROM sales_global
25202520 GROUP BY country
25212521----
25222522FRA [200.0, 50.0] 50 50
2523- TUR [100.0, 75.0] 75 75
25242523GRC [80.0, 30.0] 30 30
2524+ TUR [100.0, 75.0] 75 75
25252525
25262526# test_reverse_aggregate_expr2
25272527# Some of the Aggregators can be reversed, by this way we can still run aggregators without re-ordering
@@ -2640,7 +2640,7 @@ ProjectionExec: expr=[country@0 as country, FIRST_VALUE(sales_global.amount) ORD
26402640----SortExec: expr=[ts@1 ASC NULLS LAST]
26412641------MemoryExec: partitions=1, partition_sizes=[1]
26422642
2643- query TRRR
2643+ query TRRR rowsort
26442644SELECT country, FIRST_VALUE(amount ORDER BY ts DESC) as fv1,
26452645 LAST_VALUE(amount ORDER BY ts DESC) as lv1,
26462646 SUM(amount ORDER BY ts DESC) as sum1
@@ -2649,8 +2649,8 @@ SELECT country, FIRST_VALUE(amount ORDER BY ts DESC) as fv1,
26492649 ORDER BY ts ASC)
26502650 GROUP BY country
26512651----
2652- GRC 80 30 110
26532652FRA 200 50 250
2653+ GRC 80 30 110
26542654TUR 100 75 175
26552655
26562656# If existing ordering doesn't satisfy requirement, we should do calculations
@@ -2674,16 +2674,16 @@ ProjectionExec: expr=[country@0 as country, FIRST_VALUE(sales_global.amount) ORD
26742674----SortExec: expr=[ts@1 DESC]
26752675------MemoryExec: partitions=1, partition_sizes=[1]
26762676
2677- query TRRR
2677+ query TRRR rowsort
26782678SELECT country, FIRST_VALUE(amount ORDER BY ts DESC) as fv1,
26792679 LAST_VALUE(amount ORDER BY ts DESC) as lv1,
26802680 SUM(amount ORDER BY ts DESC) as sum1
26812681 FROM sales_global
26822682 GROUP BY country
26832683----
2684- TUR 100 75 175
2685- GRC 80 30 110
26862684FRA 200 50 250
2685+ GRC 80 30 110
2686+ TUR 100 75 175
26872687
26882688query TT
26892689EXPLAIN SELECT s.zip_code, s.country, s.sn, s.ts, s.currency, LAST_VALUE(e.amount ORDER BY e.sn) AS last_rate
@@ -2715,7 +2715,7 @@ SortExec: expr=[sn@2 ASC NULLS LAST]
27152715--------------MemoryExec: partitions=1, partition_sizes=[1]
27162716--------------MemoryExec: partitions=1, partition_sizes=[1]
27172717
2718- query ITIPTR
2718+ query ITIPTR rowsort
27192719SELECT s.zip_code, s.country, s.sn, s.ts, s.currency, LAST_VALUE(e.amount ORDER BY e.sn) AS last_rate
27202720FROM sales_global AS s
27212721JOIN sales_global AS e
@@ -2725,10 +2725,10 @@ GROUP BY s.sn, s.zip_code, s.country, s.ts, s.currency
27252725ORDER BY s.sn
27262726----
272727270 GRC 0 2022-01-01T06:00:00 EUR 30
2728+ 0 GRC 4 2022-01-03T10:00:00 EUR 80
272827291 FRA 1 2022-01-01T08:00:00 EUR 50
2729- 1 TUR 2 2022-01-01T11:30:00 TRY 75
273027301 FRA 3 2022-01-02T12:00:00 EUR 200
2731- 0 GRC 4 2022-01-03T10:00 :00 EUR 80
2731+ 1 TUR 2 2022-01-01T11:30 :00 TRY 75
273227321 TUR 4 2022-01-03T10:00:00 TRY 100
27332733
27342734# Run order-sensitive aggregators in multiple partitions
0 commit comments