| 232 | }; |
| 233 | |
| 234 | TEST_F(SpillableWindowTest, spillAgg) { |
| 235 | const vector_size_t size = 4096; |
| 236 | auto data = makeRowVector( |
| 237 | {"c1", "c2"}, |
| 238 | { |
| 239 | // aggregate column. |
| 240 | makeFlatVector<int64_t>(size, [](auto row) { return row; }), |
| 241 | // partition key. |
| 242 | makeFlatVector<int32_t>( |
| 243 | size, [](auto row) { return row < 2048 ? 1 : 2; }), |
| 244 | |
| 245 | }); |
| 246 | |
| 247 | createDuckDbTable({data}); |
| 248 | auto spillDirectory = TempDirectoryPath::create(); |
| 249 | |
| 250 | core::PlanNodeId windowId; |
| 251 | { |
| 252 | auto plan = |
| 253 | PlanBuilder() |
| 254 | .values(split(data, 10)) |
| 255 | .streamingWindow( |
| 256 | {"sum(c1) over (partition by c2 ROWS BETWEEN UNBOUNDED PRECEDING and UNBOUNDED FOLLOWING)"}) |
| 257 | .capturePlanNodeId(windowId) |
| 258 | .planNode(); |
| 259 | |
| 260 | auto task = |
| 261 | AssertQueryBuilder(plan, duckDbQueryRunner_) |
| 262 | .config(core::QueryConfig::kPreferredOutputBatchBytes, "1024") |
| 263 | .config(core::QueryConfig::kMaxOutputBatchRows, "1024") |
| 264 | .config(core::QueryConfig::kSpillEnabled, "true") |
| 265 | .config(core::QueryConfig::kWindowSpillEnabled, "true") |
| 266 | .config(core::QueryConfig::kTestingSpillPct, "100") |
| 267 | .spillDirectory(spillDirectory->path) |
| 268 | .assertResults( |
| 269 | "SELECT *, sum(c1) over (partition by c2 ROWS BETWEEN UNBOUNDED PRECEDING and UNBOUNDED FOLLOWING) FROM tmp "); |
| 270 | |
| 271 | auto taskStats = exec::toPlanStats(task->taskStats()); |
| 272 | } |
| 273 | |
| 274 | TestScopedSpillInjection scopedSpillInjection(100); |
| 275 | bytedance::bolt::exec::TestWindowInjection windowInjection( |
| 276 | WindowBuildType::kSpillableWindowBuild); |
| 277 | |
| 278 | auto plan = |
| 279 | PlanBuilder() |
| 280 | .values(split(data, 10)) |
| 281 | .window( |
| 282 | {"sum(c1) over (partition by c2 ROWS BETWEEN UNBOUNDED PRECEDING and UNBOUNDED FOLLOWING)"}) |
| 283 | .capturePlanNodeId(windowId) |
| 284 | .planNode(); |
| 285 | |
| 286 | auto task = |
| 287 | AssertQueryBuilder(plan, duckDbQueryRunner_) |
| 288 | .config(core::QueryConfig::kMaxOutputBatchRows, "100") |
| 289 | .config(core::QueryConfig::kSpillEnabled, "true") |
| 290 | .config(core::QueryConfig::kWindowSpillEnabled, "true") |
| 291 | .config(core::QueryConfig::kRowBasedSpillMode, "compression") |
nothing calls this directly
no test coverage detected