| 336 | } |
| 337 | |
| 338 | void Window::createWindowFunctions() { |
| 339 | BOLT_CHECK_NOT_NULL(windowNode_); |
| 340 | BOLT_CHECK(windowFunctions_.empty()); |
| 341 | BOLT_CHECK(windowFrames_.empty()); |
| 342 | |
| 343 | const auto& inputType = windowNode_->sources()[0]->outputType(); |
| 344 | for (const auto& windowNodeFunction : windowNode_->windowFunctions()) { |
| 345 | std::vector<WindowFunctionArg> functionArgs; |
| 346 | functionArgs.reserve(windowNodeFunction.functionCall->inputs().size()); |
| 347 | for (auto& arg : windowNodeFunction.functionCall->inputs()) { |
| 348 | auto channel = exprToChannel(arg.get(), inputType); |
| 349 | if (channel == kConstantChannel) { |
| 350 | auto constantArg = core::TypedExprs::asConstant(arg); |
| 351 | functionArgs.push_back( |
| 352 | {arg->type(), constantArg->toConstantVector(pool()), std::nullopt}); |
| 353 | } else { |
| 354 | functionArgs.push_back({arg->type(), nullptr, channel}); |
| 355 | } |
| 356 | } |
| 357 | |
| 358 | windowFunctions_.push_back(WindowFunction::create( |
| 359 | windowNodeFunction.functionCall->name(), |
| 360 | functionArgs, |
| 361 | windowNodeFunction.functionCall->type(), |
| 362 | windowNodeFunction.ignoreNulls, |
| 363 | operatorCtx_->pool(), |
| 364 | &stringAllocator_, |
| 365 | operatorCtx_->driverCtx()->queryConfig())); |
| 366 | |
| 367 | windowFrames_.push_back( |
| 368 | createWindowFrame(windowNode_, windowNodeFunction.frame, inputType)); |
| 369 | } |
| 370 | } |
| 371 | |
| 372 | void Window::createWindowFunctionsForSpillableWindowBuild() { |
| 373 | const auto& inputType = windowNode_->sources()[0]->outputType(); |
nothing calls this directly
no test coverage detected