| 292 | } |
| 293 | |
| 294 | void ChunkedNodeGroup::scan(const Transaction* transaction, const TableScanState& scanState, |
| 295 | const NodeGroupScanState& nodeGroupScanState, offset_t rowIdxInGroup, |
| 296 | length_t numRowsToScan) const { |
| 297 | DASSERT(rowIdxInGroup + numRowsToScan <= numRows); |
| 298 | auto& anchorSelVector = scanState.outState->getSelVectorUnsafe(); |
| 299 | if (getZoneMapResult(scanState, chunks) == ZoneMapCheckResult::SKIP_SCAN) { |
| 300 | anchorSelVector.setToFiltered(0); |
| 301 | return; |
| 302 | } |
| 303 | |
| 304 | if (versionInfo) { |
| 305 | versionInfo->getSelVectorToScan(transaction->getStartTS(), transaction->getID(), |
| 306 | anchorSelVector, rowIdxInGroup, numRowsToScan); |
| 307 | } else { |
| 308 | anchorSelVector.setToUnfiltered(numRowsToScan); |
| 309 | } |
| 310 | |
| 311 | if (anchorSelVector.getSelSize() > 0) { |
| 312 | for (auto i = 0u; i < scanState.columnIDs.size(); i++) { |
| 313 | const auto columnID = scanState.columnIDs[i]; |
| 314 | if (columnID == INVALID_COLUMN_ID) { |
| 315 | scanState.outputVectors[i]->setAllNull(); |
| 316 | continue; |
| 317 | } |
| 318 | if (columnID == ROW_IDX_COLUMN_ID) { |
| 319 | for (auto rowIdx = 0u; rowIdx < numRowsToScan; rowIdx++) { |
| 320 | scanState.rowIdxVector->setValue<row_idx_t>(rowIdx, |
| 321 | rowIdx + rowIdxInGroup + startRowIdx); |
| 322 | } |
| 323 | continue; |
| 324 | } |
| 325 | DASSERT(columnID < chunks.size()); |
| 326 | chunks[columnID]->scan(transaction, nodeGroupScanState.chunkStates[i], |
| 327 | *scanState.outputVectors[i], rowIdxInGroup, numRowsToScan); |
| 328 | } |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | template<ResidencyState SCAN_RESIDENCY_STATE> |
| 333 | void ChunkedNodeGroup::scanCommitted(const Transaction* transaction, TableScanState& scanState, |
nothing calls this directly
no test coverage detected