ClickHouse/dbms/src/Storages/System/StorageSystemOne.h

43 lines
1.1 KiB
C++
Raw Normal View History

2011-08-28 02:22:23 +00:00
#pragma once
2017-06-06 17:18:32 +00:00
#include <ext/shared_ptr_helper.h>
#include <Storages/IStorage.h>
2011-08-28 02:22:23 +00:00
namespace DB
{
2016-12-08 02:49:04 +00:00
class Context;
2011-08-28 02:22:23 +00:00
2017-04-16 15:00:33 +00:00
/** Implements storage for the system table One.
* The table contains a single column of dummy UInt8 and a single row with a value of 0.
* Used when the table is not specified in the query.
* Analog of the DUAL table in Oracle and MySQL.
2011-08-28 02:22:23 +00:00
*/
class StorageSystemOne : public ext::shared_ptr_helper<StorageSystemOne>, public IStorage
2011-08-28 02:22:23 +00:00
{
friend class ext::shared_ptr_helper<StorageSystemOne>;
2011-08-28 02:22:23 +00:00
public:
std::string getName() const override { return "SystemOne"; }
std::string getTableName() const override { return name; }
2011-08-28 02:22:23 +00:00
const NamesAndTypesList & getColumnsListImpl() const override { return columns; }
2011-08-28 02:22:23 +00:00
BlockInputStreams read(
const Names & column_names,
const SelectQueryInfo & query_info,
const Context & context,
QueryProcessingStage::Enum & processed_stage,
2017-06-02 15:54:39 +00:00
size_t max_block_size,
unsigned num_streams) override;
2011-08-28 02:22:23 +00:00
private:
const std::string name;
NamesAndTypesList columns;
StorageSystemOne(const std::string & name_);
2011-08-28 02:22:23 +00:00
};
}