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

Method prepare

src/Processors/Transforms/IntersectOrExceptTransform.cpp:24–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22
23
24IntersectOrExceptTransform::Status IntersectOrExceptTransform::prepare()
25{
26 auto & output = outputs.front();
27
28 if (output.isFinished())
29 {
30 for (auto & in : inputs)
31 in.close();
32
33 return Status::Finished;
34 }
35
36 if (!output.canPush())
37 {
38 for (auto & input : inputs)
39 input.setNotNeeded();
40
41 return Status::PortFull;
42 }
43
44 if (current_output_chunk)
45 {
46 output.push(std::move(current_output_chunk));
47 }
48
49 if (finished_second_input)
50 {
51 if (inputs.front().isFinished())
52 {
53 output.finish();
54 return Status::Finished;
55 }
56 }
57 else if (inputs.back().isFinished())
58 {
59 finished_second_input = true;
60 }
61
62 if (!has_input)
63 {
64 InputPort & input = finished_second_input ? inputs.front() : inputs.back();
65
66 input.setNeeded();
67 if (!input.hasData())
68 return Status::NeedData;
69
70 current_input_chunk = input.pull();
71 has_input = true;
72 }
73
74 return Status::Ready;
75}
76
77
78void IntersectOrExceptTransform::work()

Callers

nothing calls this directly

Calls 10

frontMethod · 0.80
canPushMethod · 0.80
setNotNeededMethod · 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