2013-02-07 13:40:59 +00:00
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <DB/Storages/StorageChunks.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/** Ссылка на кусок данных в таблице типа Chunks.
|
|
|
|
|
* Запись не поддерживается.
|
|
|
|
|
*/
|
|
|
|
|
class StorageChunkRef : public IStorage
|
|
|
|
|
{
|
|
|
|
|
public:
|
2013-05-05 18:02:05 +00:00
|
|
|
|
static StoragePtr create(const std::string & name_, NamesAndTypesListPtr columns_, const Context & context_, const std::string & source_database_name_, const std::string & source_table_name_, bool attach);
|
2013-02-07 13:40:59 +00:00
|
|
|
|
|
|
|
|
|
std::string getName() const { return "ChunkRef"; }
|
|
|
|
|
std::string getTableName() const { return name; }
|
|
|
|
|
|
|
|
|
|
const NamesAndTypesList & getColumnsList() const { return *columns; }
|
|
|
|
|
|
|
|
|
|
BlockInputStreams read(
|
|
|
|
|
const Names & column_names,
|
|
|
|
|
ASTPtr query,
|
|
|
|
|
const Settings & settings,
|
|
|
|
|
QueryProcessingStage::Enum & processed_stage,
|
|
|
|
|
size_t max_block_size = DEFAULT_BLOCK_SIZE,
|
|
|
|
|
unsigned threads = 1);
|
|
|
|
|
|
|
|
|
|
void dropImpl();
|
|
|
|
|
|
2013-02-08 17:06:29 +00:00
|
|
|
|
String source_database_name;
|
|
|
|
|
String source_table_name;
|
|
|
|
|
|
2013-02-07 13:40:59 +00:00
|
|
|
|
private:
|
|
|
|
|
String name;
|
|
|
|
|
NamesAndTypesListPtr columns;
|
2013-05-05 18:02:05 +00:00
|
|
|
|
const Context & context;
|
2013-02-07 13:40:59 +00:00
|
|
|
|
|
2013-05-05 18:02:05 +00:00
|
|
|
|
StorageChunkRef(const std::string & name_, NamesAndTypesListPtr columns_, const Context & context_, const std::string & source_database_name_, const std::string & source_table_name_, bool attach);
|
2013-02-07 13:40:59 +00:00
|
|
|
|
|
|
|
|
|
StorageChunks * getSource();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|