MCPcopy Create free account
hub / github.com/bytedance/bolt / createWindowFunctions

Method createWindowFunctions

bolt/exec/Window.cpp:338–370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

336}
337
338void 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
372void Window::createWindowFunctionsForSpillableWindowBuild() {
373 const auto& inputType = windowNode_->sources()[0]->outputType();

Callers

nothing calls this directly

Calls 15

exprToChannelFunction · 0.85
createWindowFrameFunction · 0.85
outputTypeMethod · 0.80
toConstantVectorMethod · 0.80
poolFunction · 0.50
createFunction · 0.50
emptyMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45
push_backMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected