| 232 | } |
| 233 | |
| 234 | StoragePtr InterpreterInsertQuery::tryGetTableInWorkerResource(const StorageID & table_id) |
| 235 | { |
| 236 | /// in some case of bitengine, server will write data into dict table and the targe table |
| 237 | /// can only be found in worker_resource |
| 238 | auto try_get_table_from_worker_resource = [&table_id](const auto & context) -> StoragePtr { |
| 239 | if (auto worker_resource = context->tryGetCnchWorkerResource(); worker_resource) |
| 240 | return worker_resource->getTable(table_id); |
| 241 | else |
| 242 | return nullptr; |
| 243 | }; |
| 244 | auto storage = try_get_table_from_worker_resource(getContext()); |
| 245 | if (storage) |
| 246 | return storage; |
| 247 | else if (auto query_context = getContext()->getQueryContext()) |
| 248 | { |
| 249 | storage = try_get_table_from_worker_resource(query_context); |
| 250 | if (storage) |
| 251 | return storage; |
| 252 | } |
| 253 | return nullptr; |
| 254 | } |
| 255 | |
| 256 | Block InterpreterInsertQuery::getSampleBlock( |
| 257 | const ASTInsertQuery & query, const StoragePtr & table, const StorageMetadataPtr & metadata_snapshot) const |
nothing calls this directly
no test coverage detected