MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / prepare

Method prepare

src/Processors/Transforms/IntersectOrExceptTransform.cpp:16–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14
15
16IntersectOrExceptTransform::Status IntersectOrExceptTransform::prepare()
17{
18 auto & output = outputs.front();
19
20 if (output.isFinished())
21 {
22 for (auto & in : inputs)
23 in.close();
24
25 return Status::Finished;
26 }
27
28 if (!output.canPush())
29 {
30 for (auto & input : inputs)
31 input.setNotNeeded();
32
33 return Status::PortFull;
34 }
35
36 if (current_output_chunk)
37 {
38 output.push(std::move(current_output_chunk));
39 }
40
41 if (!has_input)
42 {
43 while (true)
44 {
45 if (stage == Stage::ReadLeftInput)
46 {
47 auto & input = inputs.front();
48
49 if (input.isFinished())
50 {
51 inputs.back().close();
52 output.finish();
53 return Status::Finished;
54 }
55
56 input.setNeeded();
57 if (!input.hasData())
58 return Status::NeedData;
59
60 current_input_chunk = input.pull();
61 has_input = true;
62 break;
63 }
64
65 if (stage == Stage::ReadRightInput)
66 {
67 auto & input = inputs.back();
68
69 if (input.isFinished())
70 {
71 if (isIntersectOperator() && !has_right_input_rows)
72 {
73 inputs.front().close();

Callers

nothing calls this directly

Calls 11

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

Tested by

no test coverage detected