ClickHouse/src/Storages/StorageLoop.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
1.4 KiB
C++
Raw Normal View History

2024-04-24 08:11:14 +00:00
#include "StorageLoop.h"
#include <Storages/StorageFactory.h>
2024-04-25 03:30:19 +00:00
#include <Processors/QueryPlan/QueryPlan.h>
2024-04-25 15:33:36 +00:00
#include <Processors/QueryPlan/ReadFromLoopStep.h>
2024-04-24 08:11:14 +00:00
namespace DB
{
2024-05-16 13:22:54 +00:00
namespace ErrorCodes
{
2024-04-24 09:29:56 +00:00
2024-05-16 13:22:54 +00:00
}
StorageLoop::StorageLoop(
const StorageID & table_id_,
StoragePtr inner_storage_)
: IStorage(table_id_)
, inner_storage(std::move(inner_storage_))
{
StorageInMemoryMetadata storage_metadata = inner_storage->getInMemoryMetadata();
setInMemoryMetadata(storage_metadata);
}
2024-04-24 08:11:14 +00:00
2024-05-16 13:22:54 +00:00
void StorageLoop::read(
QueryPlan & query_plan,
const Names & column_names,
const StorageSnapshotPtr & storage_snapshot,
SelectQueryInfo & query_info,
ContextPtr context,
QueryProcessingStage::Enum processed_stage,
size_t max_block_size,
size_t num_streams)
{
query_info.optimize_trivial_count = false;
2024-04-25 03:30:19 +00:00
2024-05-16 13:22:54 +00:00
query_plan.addStep(std::make_unique<ReadFromLoopStep>(
column_names, query_info, storage_snapshot, context, processed_stage, inner_storage, max_block_size, num_streams
2024-04-25 15:33:36 +00:00
));
2024-05-16 13:22:54 +00:00
}
2024-04-24 08:11:14 +00:00
2024-05-16 13:22:54 +00:00
void registerStorageLoop(StorageFactory & factory)
{
factory.registerStorage("Loop", [](const StorageFactory::Arguments & args)
{
StoragePtr inner_storage;
return std::make_shared<StorageLoop>(args.table_id, inner_storage);
});
}
2024-04-24 08:11:14 +00:00
}