MCPcopy Create free account
hub / github.com/ByConity/ByConity / createFromProtoImpl

Method createFromProtoImpl

src/QueryPlan/TableWriteStep.cpp:291–310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289}
290
291std::shared_ptr<TableWriteStep::InsertTarget>
292TableWriteStep::InsertTarget::createFromProtoImpl(const Protos::TableWriteStep::InsertTarget & proto, ContextPtr context)
293{
294 auto storage_id = StorageID::fromProto(proto.storage_id(), context);
295 auto storage = DatabaseCatalog::instance().getTable(storage_id, context);
296 NamesAndTypes columns;
297 for (const auto & proto_element : proto.columns())
298 {
299 NameAndTypePair element;
300 element.fillFromProto(proto_element);
301 columns.emplace_back(std::move(element));
302 }
303 ASTPtr query;
304 if (proto.has_query())
305 query = deserializeASTFromProto(proto.query());
306
307 auto step = std::make_shared<TableWriteStep::InsertTarget>(storage, storage_id, columns, query);
308
309 return step;
310}
311
312String TableWriteStep::InsertTarget::toString(const String & remove_tenant_id) const
313{

Callers

nothing calls this directly

Calls 6

deserializeASTFromProtoFunction · 0.85
columnsMethod · 0.80
getTableMethod · 0.45
fillFromProtoMethod · 0.45
emplace_backMethod · 0.45
queryMethod · 0.45

Tested by

no test coverage detected