mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-29 13:10:48 +00:00
Test fix (removed redundant code).
This commit is contained in:
parent
ee21fde3fe
commit
f5af64514f
@ -347,23 +347,11 @@ StorageDistributed::StorageDistributed(
|
||||
void StorageDistributed::createStorage()
|
||||
{
|
||||
/// Create default policy with the relative_data_path_
|
||||
if (storage_policy.empty())
|
||||
{
|
||||
std::string path(global_context->getPath());
|
||||
/// Disk must ends with '/'
|
||||
if (!path.ends_with('/'))
|
||||
path += '/';
|
||||
auto disk = std::make_shared<DiskLocal>("default", path, 0);
|
||||
volume = std::make_shared<SingleDiskVolume>("default", disk);
|
||||
}
|
||||
else
|
||||
{
|
||||
auto policy = global_context->getStoragePolicy(storage_policy);
|
||||
if (policy->getVolumes().size() != 1)
|
||||
throw Exception("Policy for Distributed table, should have exactly one volume", ErrorCodes::BAD_ARGUMENTS);
|
||||
throw Exception("Storage policy for Distributed table, should have exactly one volume", ErrorCodes::BAD_ARGUMENTS);
|
||||
volume = policy->getVolume(0);
|
||||
}
|
||||
}
|
||||
|
||||
StoragePtr StorageDistributed::createWithOwnCluster(
|
||||
const StorageID & table_id_,
|
||||
@ -925,7 +913,7 @@ void registerStorageDistributed(StorageFactory & factory)
|
||||
String remote_table = engine_args[2]->as<ASTLiteral &>().value.safeGet<String>();
|
||||
|
||||
const auto & sharding_key = engine_args.size() >= 4 ? engine_args[3] : nullptr;
|
||||
const auto & storage_policy = engine_args.size() >= 5 ? engine_args[4]->as<ASTLiteral &>().value.safeGet<String>() : "";
|
||||
const auto & storage_policy = engine_args.size() >= 5 ? engine_args[4]->as<ASTLiteral &>().value.safeGet<String>() : "default";
|
||||
|
||||
/// Check that sharding_key exists in the table and has numeric type.
|
||||
if (sharding_key)
|
||||
|
Loading…
Reference in New Issue
Block a user