2017-04-01 09:19:00 +00:00
|
|
|
#include <Common/Exception.h>
|
2011-08-28 02:22:23 +00:00
|
|
|
|
2017-04-01 09:19:00 +00:00
|
|
|
#include <Columns/ColumnsNumber.h>
|
|
|
|
#include <DataTypes/DataTypesNumber.h>
|
|
|
|
#include <Storages/System/StorageSystemOne.h>
|
2020-01-24 17:57:27 +00:00
|
|
|
#include <Processors/Sources/SourceFromSingleChunk.h>
|
|
|
|
#include <Processors/Pipe.h>
|
2011-08-28 02:22:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
StorageSystemOne::StorageSystemOne(const std::string & name_)
|
2019-12-03 16:25:32 +00:00
|
|
|
: IStorage({"system", name_})
|
2011-08-28 02:22:23 +00:00
|
|
|
{
|
2018-03-13 14:18:11 +00:00
|
|
|
setColumns(ColumnsDescription({{"dummy", std::make_shared<DataTypeUInt8>()}}));
|
2011-08-28 02:22:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-02-19 16:07:28 +00:00
|
|
|
Pipes StorageSystemOne::read(
|
2017-04-01 07:20:54 +00:00
|
|
|
const Names & column_names,
|
2017-12-02 02:47:12 +00:00
|
|
|
const SelectQueryInfo &,
|
2018-09-08 11:29:23 +00:00
|
|
|
const Context & /*context*/,
|
|
|
|
QueryProcessingStage::Enum /*processed_stage*/,
|
2017-12-02 02:47:12 +00:00
|
|
|
const size_t /*max_block_size*/,
|
|
|
|
const unsigned /*num_streams*/)
|
2011-08-28 02:22:23 +00:00
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
check(column_names);
|
2012-05-08 11:19:00 +00:00
|
|
|
|
2020-01-24 17:57:27 +00:00
|
|
|
Block header{ColumnWithTypeAndName(
|
|
|
|
DataTypeUInt8().createColumn(),
|
2017-12-16 00:49:03 +00:00
|
|
|
std::make_shared<DataTypeUInt8>(),
|
2020-01-24 17:57:27 +00:00
|
|
|
"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;
|
2011-08-28 02:22:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|