2015-10-05 01:35:28 +00:00
|
|
|
#include <DB/Common/Exception.h>
|
2011-08-28 02:22:23 +00:00
|
|
|
|
|
|
|
#include <DB/Columns/ColumnsNumber.h>
|
2017-03-12 10:13:45 +00:00
|
|
|
#include <DB/DataTypes/DataTypesNumber.h>
|
2012-05-08 11:19:00 +00:00
|
|
|
#include <DB/DataStreams/OneBlockInputStream.h>
|
2015-09-24 03:50:09 +00:00
|
|
|
#include <DB/Storages/System/StorageSystemOne.h>
|
2011-08-28 02:22:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
StorageSystemOne::StorageSystemOne(const std::string & name_)
|
2017-04-01 07:20:54 +00:00
|
|
|
: name(name_), columns{{"dummy", std::make_shared<DataTypeUInt8>()}}
|
2011-08-28 02:22:23 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-02-06 11:26:35 +00:00
|
|
|
StoragePtr StorageSystemOne::create(const std::string & name_)
|
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
return make_shared(name_);
|
2013-02-06 11:26:35 +00:00
|
|
|
}
|
|
|
|
|
2011-08-28 02:22:23 +00:00
|
|
|
|
2012-01-09 19:20:48 +00:00
|
|
|
BlockInputStreams StorageSystemOne::read(
|
2017-04-01 07:20:54 +00:00
|
|
|
const Names & column_names,
|
|
|
|
ASTPtr query,
|
|
|
|
const Context & context,
|
|
|
|
const Settings & settings,
|
|
|
|
QueryProcessingStage::Enum & processed_stage,
|
|
|
|
const size_t max_block_size,
|
|
|
|
const unsigned threads)
|
2011-08-28 02:22:23 +00:00
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
check(column_names);
|
|
|
|
processed_stage = QueryProcessingStage::FetchColumns;
|
2012-05-08 11:19:00 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
Block block;
|
|
|
|
ColumnWithTypeAndName col;
|
|
|
|
col.name = "dummy";
|
|
|
|
col.type = std::make_shared<DataTypeUInt8>();
|
|
|
|
col.column = ColumnConstUInt8(1, 0).convertToFullColumn();
|
|
|
|
block.insert(std::move(col));
|
2014-10-29 01:18:50 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
return BlockInputStreams(1, std::make_shared<OneBlockInputStream>(block));
|
2011-08-28 02:22:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|