| 119 | } |
| 120 | |
| 121 | static void scanTableDataToChunk(const node_group_idx_t nodeGroupIdx, |
| 122 | storage::NodeTableScanState& scanState, storage::ColumnChunkData* data, |
| 123 | transaction::Transaction* transaction, storage::NodeTable& table) { |
| 124 | scanState.nodeGroupIdx = nodeGroupIdx; |
| 125 | table.initScanState(transaction, scanState); |
| 126 | |
| 127 | // We want to ensure that the offsets in the cached column match the offsets in the |
| 128 | // table |
| 129 | // To do this we write to the same offsets and set any non-selected (e.g. deleted) |
| 130 | // rows to null |
| 131 | data->getNullData()->resetToAllNull(); |
| 132 | while (table.scan(transaction, scanState)) { |
| 133 | const auto& selVector = scanState.outState->getSelVector(); |
| 134 | selVector.forEach([&](auto vectorIdx) { |
| 135 | const auto dataOffsetInGroup = |
| 136 | scanState.nodeIDVector->getValue<nodeID_t>(vectorIdx).offset - |
| 137 | storage::StorageUtils::getStartOffsetOfNodeGroup(nodeGroupIdx); |
| 138 | data->write(scanState.outputVectors[0], vectorIdx, dataOffsetInGroup); |
| 139 | }); |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | static offset_t tableFunc(const TableFuncInput& input, TableFuncOutput&) { |
| 144 | auto& bindData = input.bindData->cast<CacheArrayColumnBindData>(); |
no test coverage detected