MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / finalizeInternal

Method finalizeInternal

src/processor/operator/persistent/rel_batch_insert.cpp:240–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238}
239
240void 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
268void RelBatchInsert::updateProgress(const ExecutionContext* context) const {
269 auto progressBar = ProgressBar::Get(*context->clientContext);

Callers

nothing calls this directly

Calls 5

getWarningCountMethod · 0.80
getNumRowsMethod · 0.45
getMethod · 0.45
resetStateMethod · 0.45

Tested by

no test coverage detected