Simplify StorageDistributed ctors

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
Azat Khuzhin 2024-07-10 19:39:58 +02:00
parent c64f060496
commit 457686c379
3 changed files with 3 additions and 62 deletions

View File

@ -373,38 +373,6 @@ StorageDistributed::StorageDistributed(
}
StorageDistributed::StorageDistributed(
const StorageID & id_,
const ColumnsDescription & columns_,
const ConstraintsDescription & constraints_,
ASTPtr remote_table_function_ptr_,
const String & cluster_name_,
ContextPtr context_,
const ASTPtr & sharding_key_,
const String & storage_policy_name_,
const String & relative_data_path_,
const DistributedSettings & distributed_settings_,
LoadingStrictnessLevel mode,
ClusterPtr owned_cluster_)
: StorageDistributed(
id_,
columns_,
constraints_,
String{},
String{},
String{},
cluster_name_,
context_,
sharding_key_,
storage_policy_name_,
relative_data_path_,
distributed_settings_,
mode,
std::move(owned_cluster_),
remote_table_function_ptr_)
{
}
QueryProcessingStage::Enum StorageDistributed::getQueryProcessingStage(
ContextPtr local_context,
QueryProcessingStage::Enum to_stage,

View File

@ -63,20 +63,6 @@ public:
ClusterPtr owned_cluster_ = {},
ASTPtr remote_table_function_ptr_ = {});
StorageDistributed(
const StorageID & id_,
const ColumnsDescription & columns_,
const ConstraintsDescription & constraints_,
ASTPtr remote_table_function_ptr_,
const String & cluster_name_,
ContextPtr context_,
const ASTPtr & sharding_key_,
const String & storage_policy_name_,
const String & relative_data_path_,
const DistributedSettings & distributed_settings_,
LoadingStrictnessLevel mode,
ClusterPtr owned_cluster_ = {});
~StorageDistributed() override;
std::string getName() const override { return "Distributed"; }

View File

@ -306,21 +306,7 @@ StoragePtr TableFunctionRemote::executeImpl(const ASTPtr & /*ast_function*/, Con
cached_columns = getActualTableStructure(context, is_insert_query);
assert(cluster);
StoragePtr res = remote_table_function_ptr
? std::make_shared<StorageDistributed>(
StorageID(getDatabaseName(), table_name),
cached_columns,
ConstraintsDescription{},
remote_table_function_ptr,
String{},
context,
sharding_key,
String{},
String{},
DistributedSettings{},
LoadingStrictnessLevel::CREATE,
cluster)
: std::make_shared<StorageDistributed>(
StoragePtr res = std::make_shared<StorageDistributed>(
StorageID(getDatabaseName(), table_name),
cached_columns,
ConstraintsDescription{},
@ -334,7 +320,8 @@ StoragePtr TableFunctionRemote::executeImpl(const ASTPtr & /*ast_function*/, Con
String{},
DistributedSettings{},
LoadingStrictnessLevel::CREATE,
cluster);
cluster,
remote_table_function_ptr);
res->startup();
return res;