ClickHouse/dbms/Storages/StorageView.h

47 lines
1.2 KiB
C++
Raw Normal View History

#pragma once
#include <Parsers/ASTSelectQuery.h>
2019-03-11 14:01:45 +00:00
#include <Parsers/IAST_fwd.h>
#include <Storages/IStorage.h>
#include <ext/shared_ptr_helper.h>
namespace DB
{
class StorageView final : public ext::shared_ptr_helper<StorageView>, public IStorage
{
2019-08-26 19:07:29 +00:00
friend struct ext::shared_ptr_helper<StorageView>;
public:
std::string getName() const override { return "View"; }
2020-01-24 16:20:36 +00:00
bool isView() const override { return true; }
2017-04-16 15:00:33 +00:00
/// It is passed inside the query and solved at its level.
bool supportsSampling() const override { return true; }
bool supportsFinal() const override { return true; }
Pipes read(
const Names & column_names,
const SelectQueryInfo & query_info,
const Context & context,
QueryProcessingStage::Enum processed_stage,
size_t max_block_size,
2017-06-02 15:54:39 +00:00
unsigned num_streams) override;
ASTPtr getRuntimeViewQuery(const ASTSelectQuery & outer_query, const Context & context);
ASTPtr getRuntimeViewQuery(ASTSelectQuery * outer_query, const Context & context, bool normalize);
private:
ASTPtr inner_query;
protected:
StorageView(
2019-12-04 16:06:55 +00:00
const StorageID & table_id_,
const ASTCreateQuery & query,
const ColumnsDescription & columns_);
};
}