| 36 | |
| 37 | |
| 38 | CompressionCodecPtr CompressionCodecFactory::get(const String & family_name, std::optional<int> level) const |
| 39 | { |
| 40 | if (level) |
| 41 | { |
| 42 | auto level_literal = make_intrusive<ASTLiteral>(static_cast<UInt64>(*level)); |
| 43 | return get(makeASTFunction("CODEC", makeASTFunction(Poco::toUpper(family_name), level_literal)), {}); |
| 44 | } |
| 45 | |
| 46 | auto identifier = make_intrusive<ASTIdentifier>(Poco::toUpper(family_name)); |
| 47 | return get(makeASTFunction("CODEC", identifier), {}); |
| 48 | } |
| 49 | |
| 50 | CompressionCodecPtr CompressionCodecFactory::get(const String & compression_codec) const |
| 51 | { |