mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 01:51:59 +00:00
Accept const IStorage in SyntaxAnalyzer
This commit is contained in:
parent
df19d6aac1
commit
dcf4d5198f
@ -957,7 +957,7 @@ ExpressionAnalysisResult::ExpressionAnalysisResult(
|
||||
const ASTSelectQuery & query = *query_analyzer.getSelectQuery();
|
||||
const Context & context = query_analyzer.context;
|
||||
const Settings & settings = context.getSettingsRef();
|
||||
const StoragePtr & storage = query_analyzer.storage();
|
||||
const ConstStoragePtr & storage = query_analyzer.storage();
|
||||
|
||||
bool finalized = false;
|
||||
size_t where_step_num = 0;
|
||||
|
@ -122,7 +122,7 @@ protected:
|
||||
|
||||
SyntaxAnalyzerResultPtr syntax;
|
||||
|
||||
const StoragePtr & storage() const { return syntax->storage; } /// The main table in FROM clause, if exists.
|
||||
const ConstStoragePtr & storage() const { return syntax->storage; } /// The main table in FROM clause, if exists.
|
||||
const AnalyzedJoin & analyzedJoin() const { return *syntax->analyzed_join; }
|
||||
const NamesAndTypesList & sourceColumns() const { return syntax->required_source_columns; }
|
||||
const std::vector<const ASTFunction *> & aggregates() const { return syntax->aggregates; }
|
||||
|
@ -867,7 +867,7 @@ SyntaxAnalyzerResultPtr SyntaxAnalyzer::analyzeSelect(
|
||||
return std::make_shared<const SyntaxAnalyzerResult>(result);
|
||||
}
|
||||
|
||||
SyntaxAnalyzerResultPtr SyntaxAnalyzer::analyze(ASTPtr & query, const NamesAndTypesList & source_columns, StoragePtr storage) const
|
||||
SyntaxAnalyzerResultPtr SyntaxAnalyzer::analyze(ASTPtr & query, const NamesAndTypesList & source_columns, ConstStoragePtr storage) const
|
||||
{
|
||||
if (query->as<ASTSelectQuery>())
|
||||
throw Exception("Not select analyze for select asts.", ErrorCodes::LOGICAL_ERROR);
|
||||
|
@ -19,7 +19,7 @@ using Scalars = std::map<String, Block>;
|
||||
|
||||
struct SyntaxAnalyzerResult
|
||||
{
|
||||
StoragePtr storage;
|
||||
ConstStoragePtr storage;
|
||||
std::shared_ptr<AnalyzedJoin> analyzed_join;
|
||||
|
||||
NamesAndTypesList source_columns;
|
||||
@ -51,7 +51,7 @@ struct SyntaxAnalyzerResult
|
||||
|
||||
bool maybe_optimize_trivial_count = false;
|
||||
|
||||
SyntaxAnalyzerResult(const NamesAndTypesList & source_columns_, StoragePtr storage_ = {}, bool add_virtuals = true)
|
||||
SyntaxAnalyzerResult(const NamesAndTypesList & source_columns_, ConstStoragePtr storage_ = {}, bool add_virtuals = true)
|
||||
: storage(storage_)
|
||||
, source_columns(source_columns_)
|
||||
{
|
||||
@ -86,7 +86,7 @@ public:
|
||||
{}
|
||||
|
||||
/// Analyze and rewrite not select query
|
||||
SyntaxAnalyzerResultPtr analyze(ASTPtr & query, const NamesAndTypesList & source_columns_, StoragePtr storage = {}) const;
|
||||
SyntaxAnalyzerResultPtr analyze(ASTPtr & query, const NamesAndTypesList & source_columns_, ConstStoragePtr storage = {}) const;
|
||||
|
||||
/// Analyze and rewrite select query
|
||||
SyntaxAnalyzerResultPtr analyzeSelect(
|
||||
|
@ -10,6 +10,7 @@ namespace DB
|
||||
|
||||
class IStorage;
|
||||
|
||||
using ConstStoragePtr = std::shared_ptr<const IStorage>;
|
||||
using StoragePtr = std::shared_ptr<IStorage>;
|
||||
using Tables = std::map<String, StoragePtr>;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user