2011-08-28 02:22:23 +00:00
|
|
|
#include <DB/Core/Exception.h>
|
|
|
|
#include <DB/Core/ErrorCodes.h>
|
|
|
|
|
|
|
|
#include <DB/Columns/ColumnsNumber.h>
|
|
|
|
#include <DB/DataTypes/DataTypesNumberFixed.h>
|
2012-05-08 11:19:00 +00:00
|
|
|
#include <DB/DataStreams/OneBlockInputStream.h>
|
2011-08-28 02:22:23 +00:00
|
|
|
#include <DB/Storages/StorageSystemOne.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
StorageSystemOne::StorageSystemOne(const std::string & name_)
|
2015-03-26 23:32:16 +00:00
|
|
|
: name(name_), columns{{"dummy", new DataTypeUInt8}}
|
2011-08-28 02:22:23 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-02-06 11:26:35 +00:00
|
|
|
StoragePtr StorageSystemOne::create(const std::string & name_)
|
|
|
|
{
|
|
|
|
return (new StorageSystemOne(name_))->thisPtr();
|
|
|
|
}
|
|
|
|
|
2011-08-28 02:22:23 +00:00
|
|
|
|
2012-01-09 19:20:48 +00:00
|
|
|
BlockInputStreams StorageSystemOne::read(
|
2014-12-17 11:53:17 +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
|
|
|
{
|
|
|
|
check(column_names);
|
2012-05-22 18:32:45 +00:00
|
|
|
processed_stage = QueryProcessingStage::FetchColumns;
|
2012-05-08 11:19:00 +00:00
|
|
|
|
|
|
|
Block block;
|
2015-07-17 01:27:35 +00:00
|
|
|
ColumnWithTypeAndName col;
|
2012-05-08 11:19:00 +00:00
|
|
|
col.name = "dummy";
|
|
|
|
col.type = new DataTypeUInt8;
|
2014-10-29 01:18:50 +00:00
|
|
|
col.column = ColumnConstUInt8(1, 0).convertToFullColumn();
|
2012-05-08 11:19:00 +00:00
|
|
|
block.insert(col);
|
2014-10-29 01:18:50 +00:00
|
|
|
|
2012-05-08 11:19:00 +00:00
|
|
|
return BlockInputStreams(1, new OneBlockInputStream(block));
|
2011-08-28 02:22:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|