Minor modification

This commit is contained in:
Alexey Milovidov 2021-05-23 04:14:29 +03:00
parent 3057bbe831
commit fdc5bb72f5

View File

@ -13,6 +13,7 @@
namespace DB namespace DB
{ {
namespace ErrorCodes namespace ErrorCodes
{ {
extern const int LOGICAL_ERROR; extern const int LOGICAL_ERROR;
@ -49,14 +50,16 @@ CompressionCodecPtr CompressionCodecFactory::get(const String & family_name, std
if (level && param) if (level && param)
{ {
auto level_literal = std::make_shared<ASTLiteral>(static_cast<UInt64>(*level)); auto level_literal = std::make_shared<ASTLiteral>(static_cast<UInt64>(*level));
auto param_literal = std::make_shared<ASTLiteral>(static_cast<std::string>(*param)); auto param_literal = std::make_shared<ASTLiteral>(*param);
return get(makeASTFunction("CODEC", makeASTFunction(Poco::toUpper(family_name), level_literal, param_literal)), {}); return get(makeASTFunction("CODEC", makeASTFunction(Poco::toUpper(family_name), level_literal, param_literal)), {});
} }
else if (param) else if (param)
{ {
auto param_literal = std::make_shared<ASTLiteral>(static_cast<std::string>(*param)); auto param_literal = std::make_shared<ASTLiteral>(*param);
return get(makeASTFunction("CODEC", makeASTFunction(Poco::toUpper(family_name), param_literal)), {}); return get(makeASTFunction("CODEC", makeASTFunction(Poco::toUpper(family_name), param_literal)), {});
} else { }
else
{
return get(family_name, level); return get(family_name, level);
} }
} }