Support 'rank' and 'row_number' functions and the agg window function with default frame.
| 409 | // Support 'rank' and |
| 410 | // 'row_number' functions and the agg window function with default frame. |
| 411 | bool 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 | |
| 433 | bool Window::ignorePeer() { |
| 434 | for (const auto& windowNodeFunction : windowNode_->windowFunctions()) { |
no test coverage detected