diff --git a/src/Processors/Formats/Impl/ORCBlockOutputFormat.cpp b/src/Processors/Formats/Impl/ORCBlockOutputFormat.cpp index 4264e9da4d6..7fae2c8f480 100644 --- a/src/Processors/Formats/Impl/ORCBlockOutputFormat.cpp +++ b/src/Processors/Formats/Impl/ORCBlockOutputFormat.cpp @@ -36,22 +36,24 @@ namespace orc::CompressionKind getORCCompression(FormatSettings::ORCCompression method) { - switch (method) - { - case FormatSettings::ORCCompression::NONE: - return orc::CompressionKind::CompressionKind_NONE; - case FormatSettings::ORCCompression::SNAPPY: + if (method == FormatSettings::ORCCompression::NONE) + return orc::CompressionKind::CompressionKind_NONE; + #if USE_SNAPPY - return orc::CompressionKind::CompressionKind_SNAPPY; + if (method == FormatSettings::ORCCompression::SNAPPY) + return orc::CompressionKind::CompressionKind_SNAPPY; #endif - throw Exception(ErrorCodes::NOT_IMPLEMENTED, "Snappy compression method is not supported"); - case FormatSettings::ORCCompression::ZSTD: - return orc::CompressionKind::CompressionKind_ZSTD; - case FormatSettings::ORCCompression::LZ4: - return orc::CompressionKind::CompressionKind_LZ4; - case FormatSettings::ORCCompression::ZLIB: - return orc::CompressionKind::CompressionKind_ZLIB; - } + + if (method == FormatSettings::ORCCompression::ZSTD) + return orc::CompressionKind::CompressionKind_ZSTD; + + if (method == FormatSettings::ORCCompression::LZ4) + return orc::CompressionKind::CompressionKind_LZ4; + + if (method == FormatSettings::ORCCompression::ZLIB) + return orc::CompressionKind::CompressionKind_ZLIB; + + throw Exception(ErrorCodes::NOT_IMPLEMENTED, "Unsupported compression method"); } }