| 111 | } |
| 112 | |
| 113 | void SingleLabelNodeDeleteExecutor::delete_(ExecutionContext* context) { |
| 114 | DASSERT(tableInfo.pkVector->state == info.nodeIDVector->state); |
| 115 | auto deleteState = |
| 116 | std::make_unique<NodeTableDeleteState>(*info.nodeIDVector, *tableInfo.pkVector); |
| 117 | auto transaction = Transaction::Get(*context->clientContext); |
| 118 | if (!tableInfo.table->delete_(transaction, *deleteState)) { |
| 119 | return; |
| 120 | } |
| 121 | switch (info.deleteType) { |
| 122 | case DeleteNodeType::DELETE: { |
| 123 | tableInfo.deleteFromRelTable(transaction, info.nodeIDVector); |
| 124 | } break; |
| 125 | case DeleteNodeType::DETACH_DELETE: { |
| 126 | const auto& selVector = info.nodeIDVector->state->getSelVector(); |
| 127 | const auto pos = selVector[0]; |
| 128 | if (!info.nodeIDVector->isNull(pos)) { |
| 129 | appendToBatch(info.nodeIDVector->getValue<internalID_t>(pos)); |
| 130 | } |
| 131 | if (batchNodeIDs.size() >= BATCH_SIZE) { |
| 132 | flushBatch(batchNodeIDs, *batchSrcNodeIDVector, tableInfo.fwdRelTables, |
| 133 | tableInfo.bwdRelTables, transaction); |
| 134 | batchNodeIDs.clear(); |
| 135 | } |
| 136 | } break; |
| 137 | default: |
| 138 | UNREACHABLE_CODE; |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | void MultiLabelNodeDeleteExecutor::init(ResultSet* resultSet, ExecutionContext* context) { |
| 143 | NodeDeleteExecutor::init(resultSet, context); |
no test coverage detected