ClickHouse/dbms/src/Storages/StorageSystemOne.cpp

49 lines
1.0 KiB
C++
Raw Normal View History

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
{
}
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(
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;
ColumnWithNameAndType col;
col.name = "dummy";
col.type = new DataTypeUInt8;
col.column = ColumnConstUInt8(1, 0).convertToFullColumn();
2012-05-08 11:19:00 +00:00
block.insert(col);
2012-05-08 11:19:00 +00:00
return BlockInputStreams(1, new OneBlockInputStream(block));
2011-08-28 02:22:23 +00:00
}
}