mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-01 20:12:02 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
#include <Common/Exception.h>
|
|
|
|
#include <Columns/ColumnsNumber.h>
|
|
#include <DataTypes/DataTypesNumber.h>
|
|
#include <Storages/System/StorageSystemOne.h>
|
|
#include <Processors/Sources/SourceFromSingleChunk.h>
|
|
#include <Processors/Pipe.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
|
|
StorageSystemOne::StorageSystemOne(const std::string & name_)
|
|
: IStorage({"system", name_})
|
|
{
|
|
setColumns(ColumnsDescription({{"dummy", std::make_shared<DataTypeUInt8>()}}));
|
|
}
|
|
|
|
|
|
Pipes StorageSystemOne::read(
|
|
const Names & column_names,
|
|
const SelectQueryInfo &,
|
|
const Context & /*context*/,
|
|
QueryProcessingStage::Enum /*processed_stage*/,
|
|
const size_t /*max_block_size*/,
|
|
const unsigned /*num_streams*/)
|
|
{
|
|
check(column_names);
|
|
|
|
Block header{ColumnWithTypeAndName(
|
|
DataTypeUInt8().createColumn(),
|
|
std::make_shared<DataTypeUInt8>(),
|
|
"dummy")};
|
|
|
|
auto column = DataTypeUInt8().createColumnConst(1, 0u)->convertToFullColumnIfConst();
|
|
Chunk chunk({ std::move(column) }, 1);
|
|
|
|
Pipes pipes;
|
|
pipes.emplace_back(std::make_shared<SourceFromSingleChunk>(std::move(header), std::move(chunk)));
|
|
|
|
return pipes;
|
|
}
|
|
|
|
|
|
}
|