MCPcopy Create free account
hub / github.com/apache/impala / CountRowsToCopy

Method CountRowsToCopy

be/src/exec/iceberg-delete-node.cc:293–320  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291}
292
293int IR_ALWAYS_INLINE IcebergDeleteNode::CountRowsToCopy(const RoaringBitmap64* deletes,
294 int remaining_capacity, RoaringBitmap64::Iterator* deletes_it,
295 RowBatch::Iterator* probe_it) {
296 DCHECK(!probe_it->AtEnd());
297 int rows_to_copy = 0;
298 int rows_to_copy_max = std::min(probe_it->RemainingRows(), remaining_capacity);
299 DCHECK_GT(rows_to_copy_max, 0);
300 if (deletes == nullptr) {
301 probe_it->Advance(rows_to_copy_max);
302 return rows_to_copy_max;
303 }
304
305 uint64_t current_probe_pos = ProbeFilePosition(*probe_it);
306 probe_it->Next();
307 uint64_t next_deleted_pos = deletes_it->GetEqualOrLarger(current_probe_pos);
308 while (current_probe_pos < next_deleted_pos) {
309 ++rows_to_copy;
310 if (rows_to_copy == rows_to_copy_max) break;
311 current_probe_pos = ProbeFilePosition(*probe_it);
312 probe_it->Next();
313 // If the rows are filtered in the SCAN then the position values may increase
314 // by more than one, so let's adjust 'next_deleted_pos'.
315 if (current_probe_pos > next_deleted_pos) {
316 next_deleted_pos = deletes_it->GetEqualOrLarger(current_probe_pos);
317 }
318 }
319 return rows_to_copy;
320}
321
322int IcebergDeleteNode::ProcessProbeBatch(
323 TPrefetchMode::type prefetch_mode, RowBatch* out_batch) {

Callers

nothing calls this directly

Calls 6

minFunction · 0.85
RemainingRowsMethod · 0.80
GetEqualOrLargerMethod · 0.80
AtEndMethod · 0.45
AdvanceMethod · 0.45
NextMethod · 0.45

Tested by

no test coverage detected