| 239 | } |
| 240 | |
| 241 | std::shared_ptr<WindowStep> WindowStep::fromProto(const Protos::WindowStep & proto, ContextPtr) |
| 242 | { |
| 243 | auto [step_description, base_input_stream] = ITransformingStep::deserializeFromProtoBase(proto.query_plan_base()); |
| 244 | WindowDescription window_description; |
| 245 | window_description.fillFromProto(proto.window_description()); |
| 246 | std::vector<WindowFunctionDescription> window_functions; |
| 247 | for (const auto & proto_element : proto.window_functions()) |
| 248 | { |
| 249 | WindowFunctionDescription element; |
| 250 | element.fillFromProto(proto_element); |
| 251 | window_functions.emplace_back(std::move(element)); |
| 252 | } |
| 253 | auto need_sort = proto.need_sort(); |
| 254 | SortDescription prefix_description; |
| 255 | for (const auto & proto_element : proto.prefix_description()) |
| 256 | { |
| 257 | SortColumnDescription element; |
| 258 | element.fillFromProto(proto_element); |
| 259 | prefix_description.emplace_back(std::move(element)); |
| 260 | } |
| 261 | auto step = std::make_shared<WindowStep>(base_input_stream, window_description, window_functions, need_sort, prefix_description); |
| 262 | step->setStepDescription(step_description); |
| 263 | return step; |
| 264 | } |
| 265 | |
| 266 | void WindowStep::scatterByPartitionIfNeeded(QueryPipeline& pipeline) |
| 267 | { |
nothing calls this directly
no test coverage detected