Apache DataFusion SQL Query Engine
Make Topk aggregate tests deterministic (#8998)
Mustafa Akurbee7136a04c6
diff --git a/datafusion/sqllogictest/test_files/aggregates_topk.slt b/datafusion/sqllogictest/test_files/aggregates_topk.sltindex 6b6204e09f..bd8f00e041 100644--- a/datafusion/sqllogictest/test_files/aggregates_topk.slt+++ b/datafusion/sqllogictest/test_files/aggregates_topk.slt@@ -26,9 +26,11 @@ CREATE TABLE traces(trace_id varchar, timestamp bigint, other bigint) AS VALUES('a', NULL, NULL),('a', 1, 1),('a', -1, -1),-('b', 0, 0),-('c', 1, 1),+('b', -2, 0),+('c', 4, 1),+('c', 4, 2),('c', 2, 2),+('c', 2, 4),('b', 3, 3);statement ok@@ -57,34 +59,34 @@ GlobalLimitExec: skip=0, fetch=4query TIselect trace_id, MAX(timestamp) from traces group by trace_id order by MAX(timestamp) desc limit 4;----+c 4b 3-c 2a 1NULL 0query TIselect trace_id, MIN(timestamp) from traces group by trace_id order by MIN(timestamp) asc limit 4;----+b -2a -1NULL 0-b 0-c 1+c 2query TIIselect trace_id, other, MIN(timestamp) from traces group by trace_id, other order by MIN(timestamp) asc limit 4;----+b 0 -2a -1 -1-b 0 0NULL 0 0-c 1 1+a 1 1query TIIselect trace_id, MIN(other), MIN(timestamp) from traces group by trace_id order by MIN(timestamp), MIN(other) limit 4;----+b 0 -2a -1 -1NULL 0 0-b 0 0-c 1 1+c 1 2statement okset datafusion.optimizer.enable_topk_aggregation = true;@@ -168,45 +170,45 @@ GlobalLimitExec: skip=0, fetch=4query TIselect trace_id, MAX(timestamp) from traces group by trace_id order by MAX(timestamp) desc limit 4;----+c 4b 3-c 2a 1NULL 0query TIselect trace_id, MIN(timestamp) from traces group by trace_id order by MIN(timestamp) asc limit 4;----+b -2a -1NULL 0-b 0-c 1+c 2query TIselect trace_id, MAX(timestamp) from traces group by trace_id order by MAX(timestamp) desc limit 3;----+c 4b 3-c 2a 1query TIselect trace_id, MIN(timestamp) from traces group by trace_id order by MIN(timestamp) asc limit 3;----+b -2a -1NULL 0-b 0query TIIselect trace_id, other, MIN(timestamp) from traces group by trace_id, other order by MIN(timestamp) asc limit 4;----+b 0 -2a -1 -1-b 0 0NULL 0 0-c 1 1+a 1 1query TIIselect trace_id, MIN(other), MIN(timestamp) from traces group by trace_id order by MIN(timestamp), MIN(other) limit 4;----+b 0 -2a -1 -1NULL 0 0-b 0 0-c 1 1+c 1 2