| 238 | } |
| 239 | |
| 240 | void RelBatchInsert::finalizeInternal(ExecutionContext* context) { |
| 241 | const auto relInfo = info->ptrCast<RelBatchInsertInfo>(); |
| 242 | if (relInfo->direction == RelDataDirection::FWD) { |
| 243 | DASSERT(relInfo->partitioningIdx == 0); |
| 244 | |
| 245 | auto outputMsg = std::format("{} tuples have been copied to the {} table.", |
| 246 | sharedState->getNumRows(), relInfo->tableName); |
| 247 | auto clientContext = context->clientContext; |
| 248 | FactorizedTableUtils::appendStringToTable(sharedState->fTable.get(), outputMsg, |
| 249 | MemoryManager::Get(*clientContext)); |
| 250 | |
| 251 | auto warningContext = WarningContext::Get(*context->clientContext); |
| 252 | const auto warningCount = warningContext->getWarningCount(context->queryID); |
| 253 | if (warningCount > 0) { |
| 254 | auto warningMsg = |
| 255 | std::format("{} warnings encountered during copy. Use 'CALL " |
| 256 | "show_warnings() RETURN *' to view the actual warnings. Query ID: {}", |
| 257 | warningCount, context->queryID); |
| 258 | FactorizedTableUtils::appendStringToTable(sharedState->fTable.get(), warningMsg, |
| 259 | MemoryManager::Get(*context->clientContext)); |
| 260 | warningContext->defaultPopulateAllWarnings(context->queryID); |
| 261 | } |
| 262 | } |
| 263 | sharedState->numRows.store(0); |
| 264 | sharedState->table->cast<RelTable>().setHasChanges(); |
| 265 | partitionerSharedState->resetState(relInfo->partitioningIdx); |
| 266 | } |
| 267 | |
| 268 | void RelBatchInsert::updateProgress(const ExecutionContext* context) const { |
| 269 | auto progressBar = ProgressBar::Get(*context->clientContext); |
nothing calls this directly
no test coverage detected