From 0b3053b0f84cc0935d27d4a59932ce32a2176ff6 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Wed, 11 Sep 2024 10:02:30 -0400 Subject: [PATCH] Apply suggestions from code review --- datafusion/sqllogictest/test_files/limit.slt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/datafusion/sqllogictest/test_files/limit.slt b/datafusion/sqllogictest/test_files/limit.slt index bbed3ce4ad26..5b98392f1aa0 100644 --- a/datafusion/sqllogictest/test_files/limit.slt +++ b/datafusion/sqllogictest/test_files/limit.slt @@ -569,6 +569,7 @@ drop table data; #################### # Test issue: limit pushdown with offsets +# Ensure the offset is not lost: https://github.com/apache/datafusion/issues/12423 #################### statement ok @@ -617,6 +618,7 @@ SELECT b, sum(a) FROM ordered_table GROUP BY b order by b desc OFFSET 1 LIMIT 2; 1 0 # Applying offset & limit when multiple streams from groupby +# the plan must still have a global limit to apply the offset query TT EXPLAIN SELECT b, sum(a) FROM ordered_table GROUP BY b order by b desc OFFSET 1 LIMIT 2; ---- @@ -637,6 +639,7 @@ physical_plan 09)----------------CsvExec: file_groups={1 group: [[WORKSPACE_ROOT/datafusion/core/tests/data/window_2.csv]]}, projection=[a, b], has_header=true # Applying offset & limit when multiple streams from union +# the plan must still have a global limit to apply the offset query TT explain select * FROM ( select c FROM ordered_table @@ -665,7 +668,7 @@ physical_plan 10)----------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1 11)------------CsvExec: file_groups={1 group: [[WORKSPACE_ROOT/datafusion/core/tests/data/window_2.csv]]}, projection=[d], has_header=true -# ApplyingmLIMIT & OFFSET to subquery. +# Applying LIMIT & OFFSET to subquery. query III select t1.b, c, c2 FROM ( select b, c FROM ordered_table ORDER BY b desc, c desc OFFSET 1 LIMIT 4