MCPcopy Create free account
hub / github.com/ByConity/ByConity / prepareGenerate

Method prepareGenerate

src/Processors/Transforms/SortingTransform.cpp:282–328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282IProcessor::Status SortingTransform::prepareGenerate()
283{
284 auto & output = outputs.front();
285
286 if (output.isFinished())
287 {
288 for (auto & input : inputs)
289 input.close();
290
291 return Status::Finished;
292 }
293
294 if (!output.canPush())
295 return Status::PortFull;
296
297 if (merge_sorter)
298 {
299 if (!generated_chunk)
300 return Status::Ready;
301
302 output.push(std::move(generated_chunk));
303 return Status::PortFull;
304 }
305 else
306 {
307 auto & input = inputs.back();
308
309 if (generated_chunk)
310 output.push(std::move(generated_chunk));
311
312 if (input.isFinished())
313 {
314 output.finish();
315 return Status::Finished;
316 }
317
318 input.setNeeded();
319
320 if (!input.hasData())
321 return Status::NeedData;
322
323 auto chunk = input.pull();
324 enrichChunkWithConstants(chunk);
325 output.push(std::move(chunk));
326 return Status::PortFull;
327 }
328}
329
330void SortingTransform::work()
331{

Callers

nothing calls this directly

Calls 9

frontMethod · 0.80
canPushMethod · 0.80
setNeededMethod · 0.80
hasDataMethod · 0.80
isFinishedMethod · 0.45
closeMethod · 0.45
pushMethod · 0.45
finishMethod · 0.45
pullMethod · 0.45

Tested by

no test coverage detected