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

Method findEndOfMatch

bolt/exec/MergeJoin.cpp:258–293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256}
257
258bool MergeJoin::findEndOfMatch(
259 Match& match,
260 const RowVectorPtr& input,
261 const std::vector<column_index_t>& keys) {
262 if (match.complete) {
263 return true;
264 }
265
266 auto prevInput = match.inputs.back();
267 auto prevIndex = prevInput->size() - 1;
268
269 auto numInput = input->size();
270
271 vector_size_t endIndex = 0;
272 while (endIndex < numInput &&
273 compare(keys, input, endIndex, keys, prevInput, prevIndex) == 0) {
274 ++endIndex;
275 }
276
277 if (endIndex == numInput) {
278 // Inputs are kept past getting a new batch of inputs. LazyVectors
279 // must be loaded before advancing to the next batch.
280 loadColumns(input, *operatorCtx_->execCtx());
281 match.inputs.push_back(input);
282 match.endIndex = endIndex;
283 return false;
284 }
285
286 if (endIndex > 0) {
287 // Match ends here, no need to pre-load lazies.
288 match.inputs.push_back(input);
289 match.endIndex = endIndex;
290 }
291 match.complete = true;
292 return true;
293}
294
295namespace {
296void copyRow(

Callers

nothing calls this directly

Calls 6

loadColumnsFunction · 0.85
backMethod · 0.80
compareFunction · 0.70
sizeMethod · 0.45
execCtxMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected