mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-12 09:22:05 +00:00
upd error
This commit is contained in:
parent
c3f1784dbc
commit
83368a4866
@ -4,6 +4,8 @@
|
|||||||
#include <IO/WriteHelpers.h>
|
#include <IO/WriteHelpers.h>
|
||||||
#include <IO/ReadHelpers.h>
|
#include <IO/ReadHelpers.h>
|
||||||
|
|
||||||
|
#include <numeric>
|
||||||
|
|
||||||
|
|
||||||
namespace DB
|
namespace DB
|
||||||
{
|
{
|
||||||
@ -62,7 +64,15 @@ std::unique_ptr<MergeTreeIndex> MergeTreeIndexFactory::get(std::shared_ptr<ASTIn
|
|||||||
auto it = indexes.find(node->type->name);
|
auto it = indexes.find(node->type->name);
|
||||||
if (it == indexes.end())
|
if (it == indexes.end())
|
||||||
throw Exception(
|
throw Exception(
|
||||||
"Unknown Index type '" + node->type->name + "'",
|
"Unknown Index type '" + node->type->name + "'. Available index types: " +
|
||||||
|
std::accumulate(indexes.cbegin(), indexes.cend(), std::string{},
|
||||||
|
[] (auto && lft, const auto & rht) -> std::string {
|
||||||
|
if (lft == "") {
|
||||||
|
return rht.first;
|
||||||
|
} else {
|
||||||
|
return lft + ", " + rht.first;
|
||||||
|
}
|
||||||
|
}) + ".",
|
||||||
ErrorCodes::INCORRECT_QUERY);
|
ErrorCodes::INCORRECT_QUERY);
|
||||||
return it->second(node);
|
return it->second(node);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user