Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
review: tighten spill slt tests
  • Loading branch information
2010YOUY01 committed Aug 2, 2026
commit e242c5e161124982b95eaf4df299bfb29db33419
24 changes: 12 additions & 12 deletions datafusion/sqllogictest/test_files/aggregate_memory_spill.slt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ FROM (
----
100000 5000050000

# Assert spill happened, the `spilled_rows` metric shows several 'K'
# Assert spill happened, the `spill_count` metric must be > 0
query TT
EXPLAIN ANALYZE
SELECT count(*), sum(total)
Expand All @@ -61,7 +61,7 @@ FROM (
)
----
<slt:ignore>
04)------AggregateExec: mode=Single, gby=[v@0 * 7 % 100000 as t.v * Int64(7) % Int64(100000)], aggr=[sum(t.v)], metrics=[<slt:ignore>spilled_rows=<slt:ignore>K,<slt:ignore>]
04)------AggregateExec: mode=Single, gby=[v@0 * 7 % 100000 as t.v * Int64(7) % Int64(100000)], aggr=[sum(t.v)], metrics=[<slt:ignore>spill_count=7,<slt:ignore>]
<slt:ignore>

# --- Case B: multi-column GROUP BY (is_single() = false) ---
Expand All @@ -76,7 +76,7 @@ FROM (
----
100000 5000050000

# Assert spill happened, the `spilled_rows` metric shows several 'K'
# Assert spill happened, the `spill_count` metric must be > 0
query TT
EXPLAIN ANALYZE
SELECT count(*), sum(total)
Expand All @@ -87,7 +87,7 @@ FROM (
)
----
<slt:ignore>
04)------AggregateExec: mode=Single, gby=[v@0 * 7 % 100000 as t.v * Int64(7) % Int64(100000), v@0 * 13 % 100000 as t.v * Int64(13) % Int64(100000)], aggr=[sum(t.v)], metrics=[<slt:ignore>spilled_rows=<slt:ignore>K,<slt:ignore>]
04)------AggregateExec: mode=Single, gby=[v@0 * 7 % 100000 as t.v * Int64(7) % Int64(100000), v@0 * 13 % 100000 as t.v * Int64(13) % Int64(100000)], aggr=[sum(t.v)], metrics=[<slt:ignore>spill_count=7,<slt:ignore>]
<slt:ignore>

# --- Case C: DISTINCT aggregate under memory limit ---
Expand All @@ -102,7 +102,7 @@ FROM (
----
100000 100000

# Assert spill happened, the `spilled_rows` metric shows several 'K'
# Assert spill happened, the `spill_count` metric must be > 0
query TT
EXPLAIN ANALYZE
SELECT count(*), sum(d)
Expand All @@ -113,7 +113,7 @@ FROM (
)
----
<slt:ignore>
04)------AggregateExec: mode=Single, gby=[group_alias_0@0 as group_alias_0], aggr=[count(alias1)], metrics=[<slt:ignore>spilled_rows=<slt:ignore>K,<slt:ignore>]
04)------AggregateExec: mode=Single, gby=[group_alias_0@0 as group_alias_0], aggr=[count(alias1)], metrics=[<slt:ignore>spill_count=7,<slt:ignore>]
<slt:ignore>

# --- Case D: multiple aggregates (sum/min/max) under memory limit ---
Expand All @@ -128,7 +128,7 @@ FROM (
----
100000 5000050000 1 100000

# Assert spill happened, the `spilled_rows` metric shows several 'K'
# Assert spill happened, the `spill_count` metric must be > 0
query TT
EXPLAIN ANALYZE
SELECT count(*), sum(s), min(mn), max(mx)
Expand All @@ -139,7 +139,7 @@ FROM (
)
----
<slt:ignore>
04)------AggregateExec: mode=Single, gby=[v@0 * 7 % 100000 as t.v * Int64(7) % Int64(100000)], aggr=[sum(t.v), min(t.v), max(t.v)], metrics=[<slt:ignore>spilled_rows=<slt:ignore>K,<slt:ignore>]
04)------AggregateExec: mode=Single, gby=[v@0 * 7 % 100000 as t.v * Int64(7) % Int64(100000)], aggr=[sum(t.v), min(t.v), max(t.v)], metrics=[<slt:ignore>spill_count=7,<slt:ignore>]
<slt:ignore>

# --- Case E: avg() aggregate (Float64 output) under memory limit ---
Expand All @@ -154,7 +154,7 @@ FROM (
----
100000 1 100000

# Assert spill happened, the `spilled_rows` metric shows several 'K'
# Assert spill happened, the `spill_count` metric must be > 0
query TT
EXPLAIN ANALYZE
SELECT count(*), min(a), max(a)
Expand All @@ -165,7 +165,7 @@ FROM (
)
----
<slt:ignore>
04)------AggregateExec: mode=Single, gby=[v@0 * 7 % 100000 as t.v * Int64(7) % Int64(100000)], aggr=[avg(t.v)], metrics=[<slt:ignore>spilled_rows=<slt:ignore>K,<slt:ignore>]
04)------AggregateExec: mode=Single, gby=[v@0 * 7 % 100000 as t.v * Int64(7) % Int64(100000)], aggr=[avg(t.v)], metrics=[<slt:ignore>spill_count=7,<slt:ignore>]
<slt:ignore>

# --- Case F: array_agg() aggregate (growable state) under memory limit ---
Expand All @@ -180,7 +180,7 @@ FROM (
----
100000 100000

# Assert spill happened, the `spilled_rows` metric shows several 'K'
# Assert spill happened, the `spill_count` metric must be > 0
query TT
EXPLAIN ANALYZE
SELECT count(*), sum(l)
Expand All @@ -191,7 +191,7 @@ FROM (
)
----
<slt:ignore>
04)------AggregateExec: mode=Single, gby=[v@0 * 7 % 100000 as t.v * Int64(7) % Int64(100000)], aggr=[array_agg(t.v)], metrics=[<slt:ignore>spilled_rows=<slt:ignore>K,<slt:ignore>]
04)------AggregateExec: mode=Single, gby=[v@0 * 7 % 100000 as t.v * Int64(7) % Int64(100000)], aggr=[array_agg(t.v)], metrics=[<slt:ignore>spill_count=7,<slt:ignore>]
<slt:ignore>

# Restore settings to slt runner defaults
Expand Down
Loading