MCPcopy Create free account
hub / github.com/apache/cloudberry / BitmapNextTuple

Method BitmapNextTuple

contrib/pax_storage/src/cpp/access/pax_scanner.cc:193–218  ·  view source on GitHub ↗

should skip invisible tuple, and fetch next tuple like appendonly_scan_bitmap_next_tuple

Source from the content-addressed store, hash-verified

191// should skip invisible tuple, and fetch next tuple like
192// appendonly_scan_bitmap_next_tuple
193bool PaxScanDesc::BitmapNextTuple(struct TBMIterateResult *tbmres,
194 TupleTableSlot *slot) {
195 ItemPointerData tid;
196 if (tbmres->ntuples < 0) {
197 // lossy bitmap. The maximum value of the last 16 bits in CTID is
198 // 0x7FFF + 1, i.e. 0x8000. See layout of ItemPointerData in PAX
199 if (cindex_ > 0X8000) elog(ERROR, "unexpected offset in pax");
200
201 ItemPointerSet(&tid, tbmres->blockno, cindex_);
202 }
203 while (cindex_ < tbmres->ntuples) {
204 // The maximum value of the last 16 bits in CTID is 0x7FFF + 1,
205 // i.e. 0x8000. See layout of ItemPointerData in PAX
206 if (tbmres->offsets[cindex_] > 0X8000)
207 elog(ERROR, "unexpected offset in pax");
208 ItemPointerSet(&tid, tbmres->blockno, tbmres->offsets[cindex_]);
209
210 ++cindex_;
211 // invisible tuple should be skipped and fetch next tuple
212 if (index_desc_->FetchTuple(&tid, rs_base_.rs_snapshot, slot, nullptr,
213 nullptr)) {
214 return true;
215 }
216 }
217 return false;
218}
219
220TableScanDesc PaxScanDesc::BeginScan(Relation relation, Snapshot snapshot,
221 int nkeys, struct ScanKeyData *key,

Callers 1

ScanBitmapNextTupleMethod · 0.80

Calls 1

FetchTupleMethod · 0.80

Tested by

no test coverage detected