MCPcopy Create free account
hub / github.com/bytedance/bolt / addInput

Method addInput

bolt/exec/GroupingSet.cpp:185–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183} // namespace
184
185void GroupingSet::addInput(const RowVectorPtr& input, bool mayPushdown) {
186 if (isGlobal_) {
187 addGlobalAggregationInput(input, mayPushdown);
188 return;
189 }
190
191 auto numRows = input->size();
192 numInputRows_ += numRows;
193 if (!preGroupedKeyChannels_.empty()) {
194 if (remainingInput_) {
195 addRemainingInput();
196 }
197 // Look for the last group of pre-grouped keys.
198 for (auto i = input->size() - 2; i >= 0; --i) {
199 if (!equalKeys(preGroupedKeyChannels_, input, i, i + 1)) {
200 // Process that many rows, flush the accumulators and the hash
201 // table, then add remaining rows.
202 numRows = i + 1;
203
204 remainingInput_ = input;
205 firstRemainingRow_ = numRows;
206 remainingMayPushdown_ = mayPushdown;
207 break;
208 }
209 }
210 }
211
212 activeRows_.resize(numRows);
213 activeRows_.setAll();
214
215 addInputForActiveRows(input, mayPushdown);
216}
217
218void GroupingSet::noMoreInput() {
219 noMoreInput_ = true;

Callers 3

addInputForActiveRowsMethod · 0.45
toIntermediateMethod · 0.45

Calls 5

setAllMethod · 0.80
equalKeysFunction · 0.70
sizeMethod · 0.45
emptyMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected