| 289 | } |
| 290 | |
| 291 | std::shared_ptr<TableWriteStep::InsertTarget> |
| 292 | TableWriteStep::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 | |
| 312 | String TableWriteStep::InsertTarget::toString(const String & remove_tenant_id) const |
| 313 | { |
nothing calls this directly
no test coverage detected