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

Method supportRowsStreaming

bolt/exec/Window.cpp:411–431  ·  view source on GitHub ↗

Support 'rank' and 'row_number' functions and the agg window function with default frame.

Source from the content-addressed store, hash-verified

409// Support 'rank' and
410// 'row_number' functions and the agg window function with default frame.
411bool Window::supportRowsStreaming() {
412 for (const auto& windowNodeFunction : windowNode_->windowFunctions()) {
413 const auto& functionName = windowNodeFunction.functionCall->name();
414 auto windowFunctionMetadata =
415 exec::getWindowFunctionMetadata(functionName).value();
416 if (windowFunctionMetadata.processingUnit == ProcessingUnit::kPartition) {
417 return false;
418 }
419
420 const auto& frame = windowNodeFunction.frame;
421 bool isDefaultFrame =
422 (frame.startType == core::WindowNode::BoundType::kUnboundedPreceding &&
423 frame.endType == core::WindowNode::BoundType::kCurrentRow);
424 // Only support the agg window function with default frame.
425 if (!windowFunctionMetadata.ignoreFrame && !isDefaultFrame) {
426 return false;
427 }
428 }
429
430 return true;
431}
432
433bool Window::ignorePeer() {
434 for (const auto& windowNodeFunction : windowNode_->windowFunctions()) {

Callers 2

callApplyLoopMethod · 0.45
getOutputMethod · 0.45

Calls 3

nameMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected