Simple cleanup: context ptr usage in interpreters

This commit is contained in:
Igor Nikonov 2022-07-05 22:47:00 +00:00
parent d276d9ef8b
commit 059c5c0f0a
3 changed files with 16 additions and 16 deletions

View File

@ -12,12 +12,12 @@ namespace DB
class IInterpreterUnionOrSelectQuery : public IInterpreter
{
public:
IInterpreterUnionOrSelectQuery(const ASTPtr & query_ptr_, ContextPtr context_, const SelectQueryOptions & options_)
IInterpreterUnionOrSelectQuery(const ASTPtr & query_ptr_, const ContextPtr & context_, const SelectQueryOptions & options_)
: IInterpreterUnionOrSelectQuery(query_ptr_, Context::createCopy(context_), options_)
{
}
IInterpreterUnionOrSelectQuery(const ASTPtr & query_ptr_, ContextMutablePtr context_, const SelectQueryOptions & options_)
IInterpreterUnionOrSelectQuery(const ASTPtr & query_ptr_, const ContextMutablePtr & context_, const SelectQueryOptions & options_)
: query_ptr(query_ptr_)
, context(context_)
, options(options_)

View File

@ -159,7 +159,7 @@ String InterpreterSelectQuery::generateFilterActions(ActionsDAGPtr & actions, co
InterpreterSelectQuery::InterpreterSelectQuery(
const ASTPtr & query_ptr_,
ContextPtr context_,
const ContextPtr & context_,
const SelectQueryOptions & options_,
const Names & required_result_column_names_)
: InterpreterSelectQuery(query_ptr_, context_, std::nullopt, nullptr, options_, required_result_column_names_)
@ -167,7 +167,7 @@ InterpreterSelectQuery::InterpreterSelectQuery(
InterpreterSelectQuery::InterpreterSelectQuery(
const ASTPtr & query_ptr_,
ContextMutablePtr context_,
const ContextMutablePtr & context_,
const SelectQueryOptions & options_,
const Names & required_result_column_names_)
: InterpreterSelectQuery(query_ptr_, context_, std::nullopt, nullptr, options_, required_result_column_names_)
@ -175,7 +175,7 @@ InterpreterSelectQuery::InterpreterSelectQuery(
InterpreterSelectQuery::InterpreterSelectQuery(
const ASTPtr & query_ptr_,
ContextPtr context_,
const ContextPtr & context_,
Pipe input_pipe_,
const SelectQueryOptions & options_)
: InterpreterSelectQuery(query_ptr_, context_, std::move(input_pipe_), nullptr, options_.copy().noSubquery())
@ -183,7 +183,7 @@ InterpreterSelectQuery::InterpreterSelectQuery(
InterpreterSelectQuery::InterpreterSelectQuery(
const ASTPtr & query_ptr_,
ContextPtr context_,
const ContextPtr & context_,
const StoragePtr & storage_,
const StorageMetadataPtr & metadata_snapshot_,
const SelectQueryOptions & options_)
@ -192,7 +192,7 @@ InterpreterSelectQuery::InterpreterSelectQuery(
InterpreterSelectQuery::InterpreterSelectQuery(
const ASTPtr & query_ptr_,
ContextPtr context_,
const ContextPtr & context_,
const SelectQueryOptions & options_,
SubqueriesForSets subquery_for_sets_,
PreparedSets prepared_sets_)
@ -282,7 +282,7 @@ static bool shouldIgnoreQuotaAndLimits(const StorageID & table_id)
InterpreterSelectQuery::InterpreterSelectQuery(
const ASTPtr & query_ptr_,
ContextPtr context_,
const ContextPtr & context_,
std::optional<Pipe> input_pipe_,
const StoragePtr & storage_,
const SelectQueryOptions & options_,
@ -304,7 +304,7 @@ InterpreterSelectQuery::InterpreterSelectQuery(
InterpreterSelectQuery::InterpreterSelectQuery(
const ASTPtr & query_ptr_,
ContextMutablePtr context_,
const ContextMutablePtr & context_,
std::optional<Pipe> input_pipe_,
const StoragePtr & storage_,
const SelectQueryOptions & options_,

View File

@ -52,27 +52,27 @@ public:
InterpreterSelectQuery(
const ASTPtr & query_ptr_,
ContextPtr context_,
const ContextPtr & context_,
const SelectQueryOptions &,
const Names & required_result_column_names_ = Names{});
InterpreterSelectQuery(
const ASTPtr & query_ptr_,
ContextMutablePtr context_,
const ContextMutablePtr & context_,
const SelectQueryOptions &,
const Names & required_result_column_names_ = Names{});
/// Read data not from the table specified in the query, but from the prepared pipe `input`.
InterpreterSelectQuery(
const ASTPtr & query_ptr_,
ContextPtr context_,
const ContextPtr & context_,
Pipe input_pipe_,
const SelectQueryOptions & = {});
/// Read data not from the table specified in the query, but from the specified `storage_`.
InterpreterSelectQuery(
const ASTPtr & query_ptr_,
ContextPtr context_,
const ContextPtr & context_,
const StoragePtr & storage_,
const StorageMetadataPtr & metadata_snapshot_ = nullptr,
const SelectQueryOptions & = {});
@ -81,7 +81,7 @@ public:
/// TODO: Find a general way of sharing sets among different interpreters, such as subqueries.
InterpreterSelectQuery(
const ASTPtr & query_ptr_,
ContextPtr context_,
const ContextPtr & context_,
const SelectQueryOptions &,
SubqueriesForSets subquery_for_sets_,
PreparedSets prepared_sets_);
@ -134,7 +134,7 @@ public:
private:
InterpreterSelectQuery(
const ASTPtr & query_ptr_,
ContextPtr context_,
const ContextPtr & context_,
std::optional<Pipe> input_pipe,
const StoragePtr & storage_,
const SelectQueryOptions &,
@ -145,7 +145,7 @@ private:
InterpreterSelectQuery(
const ASTPtr & query_ptr_,
ContextMutablePtr context_,
const ContextMutablePtr & context_,
std::optional<Pipe> input_pipe,
const StoragePtr & storage_,
const SelectQueryOptions &,