Remove unnecessary checks

This commit is contained in:
Konstantin Bogdanov 2024-11-20 15:54:42 +01:00
parent e3e6c79d72
commit b47a95bd4f
No known key found for this signature in database
2 changed files with 1 additions and 38 deletions

View File

@ -123,27 +123,8 @@ StoragePtr TableFunctionObjectStorage<Definition, Configuration>::executeImpl(
columns = cached_columns;
StoragePtr storage;
if (context->getClientInfo().query_kind == ClientInfo::QueryKind::SECONDARY_QUERY)
{
storage = std::make_shared<StorageObjectStorage>(
configuration,
getObjectStorage(context, !is_insert_query),
context,
StorageID(getDatabaseName(), table_name),
columns,
ConstraintsDescription{},
/* comment */ String{},
/* format_settings */ std::nullopt,
/* mode */ LoadingStrictnessLevel::CREATE,
/* distributed_processing */ true,
/* partition_by */ nullptr);
storage->startup();
return storage;
}
const auto & settings = context->getSettingsRef();
auto parallel_replicas_cluster_name = settings[Setting::cluster_for_parallel_replicas].toString();
auto can_use_parallel_replicas = settings[Setting::allow_experimental_parallel_reading_from_replicas] > 0
&& settings[Setting::parallel_replicas_for_cluster_engines]

View File

@ -132,24 +132,6 @@ StoragePtr TableFunctionURL::getStorage(
const String & source, const String & format_, const ColumnsDescription & columns, ContextPtr global_context,
const std::string & table_name, const String & compression_method_) const
{
if (global_context->getClientInfo().query_kind == ClientInfo::QueryKind::SECONDARY_QUERY)
{
return std::make_shared<StorageURL>(
source,
StorageID(getDatabaseName(), table_name),
format_,
std::nullopt /*format settings*/,
columns,
ConstraintsDescription{},
String{},
global_context,
compression_method_,
configuration.headers,
configuration.http_method,
nullptr,
/*distributed_processing*/ true);
}
const auto & settings = global_context->getSettingsRef();
auto parallel_replicas_cluster_name = settings[Setting::cluster_for_parallel_replicas].toString();
auto can_use_parallel_replicas = settings[Setting::allow_experimental_parallel_reading_from_replicas] > 0