ClickHouse/dbms/src/Storages/StorageSystemOne.cpp

45 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_)
: name(name_)
{
2011-11-01 17:12:11 +00:00
columns.push_back(NameAndTypePair("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 Settings & settings,
QueryProcessingStage::Enum & processed_stage, size_t max_block_size, 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 = new ColumnConstUInt8(1, 0);
block.insert(col);
return BlockInputStreams(1, new OneBlockInputStream(block));
2011-08-28 02:22:23 +00:00
}
}