36
36
statement ok
37
37
set max_threads=4;
38
38
39
+ # Disable sort spilling
40
+ statement ok
41
+ set sort_spilling_memory_ratio = 0;
42
+
39
43
query T
40
44
explain pipeline SELECT depname, empno, salary, sum(salary) OVER (PARTITION BY depname ORDER BY empno) FROM empsalary ORDER BY depname, empno;
41
45
----
@@ -52,6 +56,30 @@ CompoundBlockOperator(Project) × 1 processor
52
56
DeserializeDataTransform × 1 processor
53
57
SyncReadParquetDataSource × 1 processor
54
58
59
+
60
+ # Enable sort spilling
61
+ statement ok
62
+ set sort_spilling_memory_ratio = 60;
63
+
64
+ query T
65
+ explain pipeline SELECT depname, empno, salary, sum(salary) OVER (PARTITION BY depname ORDER BY empno) FROM empsalary ORDER BY depname, empno;
66
+ ----
67
+ CompoundBlockOperator(Project) × 1 processor
68
+ Merge (TransformSortSpill × 4 processors) to (CompoundBlockOperator(Project) × 1)
69
+ TransformSortSpill × 4 processors
70
+ TransformSortMerge × 4 processors
71
+ SortPartialTransform × 4 processors
72
+ Merge (Transform Window × 1 processor) to (SortPartialTransform × 4)
73
+ Transform Window × 1 processor
74
+ Merge (TransformSortSpill × 4 processors) to (Transform Window × 1)
75
+ TransformSortSpill × 4 processors
76
+ TransformSortMerge × 4 processors
77
+ SortPartialTransform × 4 processors
78
+ Merge (DeserializeDataTransform × 1 processor) to (SortPartialTransform × 4)
79
+ DeserializeDataTransform × 1 processor
80
+ SyncReadParquetDataSource × 1 processor
81
+
82
+
55
83
statement ok
56
84
DROP TABLE IF EXISTS Test
57
85
@@ -292,6 +320,11 @@ drop table if exists t
292
320
statement ok
293
321
create table t (a int, b int, c string, d int, e int, f string)
294
322
323
+
324
+ # Disable sort spilling
325
+ statement ok
326
+ set sort_spilling_memory_ratio = 0;
327
+
295
328
# range frame (can not push down limit)
296
329
query T
297
330
explain pipeline select a, sum(a) over (partition by a order by a desc) from t limit 3
@@ -306,6 +339,30 @@ CompoundBlockOperator(Project) × 1 processor
306
339
DeserializeDataTransform × 1 processor
307
340
SyncReadParquetDataSource × 1 processor
308
341
342
+ # Enable sort spilling
343
+ statement ok
344
+ set sort_spilling_memory_ratio = 60;
345
+
346
+ # range frame (can not push down limit)
347
+ query T
348
+ explain pipeline select a, sum(a) over (partition by a order by a desc) from t limit 3
349
+ ----
350
+ CompoundBlockOperator(Project) × 1 processor
351
+ LimitTransform × 1 processor
352
+ Transform Window × 1 processor
353
+ Merge (TransformSortSpill × 4 processors) to (Transform Window × 1)
354
+ TransformSortSpill × 4 processors
355
+ TransformSortMerge × 4 processors
356
+ SortPartialTransform × 4 processors
357
+ Merge (DeserializeDataTransform × 1 processor) to (SortPartialTransform × 4)
358
+ DeserializeDataTransform × 1 processor
359
+ SyncReadParquetDataSource × 1 processor
360
+
361
+
362
+ # Disable sort spilling
363
+ statement ok
364
+ set sort_spilling_memory_ratio = 0;
365
+
309
366
# range frame with ranking function (can push down limit)
310
367
query T
311
368
explain pipeline select a, dense_rank() over (partition by a order by a desc) from t limit 3
0 commit comments